HomePhabricator

[CMAKE] Fix bitcoind cross build for OSX

Description

[CMAKE] Fix bitcoind cross build for OSX

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).

Reviewers: #bitcoin_abc, deadalnix

Reviewed By: #bitcoin_abc, deadalnix

Differential Revision: https://reviews.bitcoinabc.org/D3032

Details

Provenance
FabienAuthored on May 13 2019, 10:00
FabienPushed on May 17 2019, 19:57
Reviewer
Restricted Project
Differential Revision
D3032: [CMAKE] Fix bitcoind cross build for OSX
Parents
rABC4c604db82bfb: [CMAKE] Cleanup the OSX platform file
Branches
Unknown
Tags
Unknown