Page MenuHomePhabricator

[CMAKE] Fix bitcoind cross build for OSX
ClosedPublic

Authored by Fabien on May 13 2019, 10:15.

Details

Summary

Use CMAKE_<LANG>_FLAGS_INIT (note the _INIT) variables to set the
target. This variable will set the corresponding CMAKE_<LANG>_FLAGS
variable, but is also used to initalize the CMAKE_REQUIRED_FLAGS for
various check_xxx functions such as check_include_file() or
check_symbol_exist(). This fixes the architecture mismatch issue.

Depends on D3031.

Test Plan
mkdir buildcmake && cd buildcmake
cmake -GNinja -DCMAKE_TOOLCHAIN_FILE=../cmake/platforms/OSX.cmake \
-DBUILD_BITCOIN_QT=OFF ..
ninja

The build should succeed.
Check the generated src/bitcoind runs on OSX >= 10.8 (tested on OSX
Sierra 10.12.6).

Diff Detail

Repository
rABC Bitcoin ABC
Branch
cmake_osx_fix_bitcoind
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 5828
Build 9718: Bitcoin ABC Buildbot (legacy)
Build 9717: arc lint + arc unit

Event Timeline

I'm pretty sure the dependency graph for this is completely wrong.

This revision is now accepted and ready to land.May 16 2019, 16:58
This revision was automatically updated to reflect the committed changes.