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
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

Fabien created this revision.May 13 2019, 10:15
Herald added a reviewer: Restricted Project. · View Herald TranscriptMay 13 2019, 10:16
deadalnix accepted this revision.May 16 2019, 16:58

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.