Page MenuHomePhabricator

[CMAKE] Fix CMake cross build for OSX
AbandonedPublic

Authored by Fabien on May 10 2019, 11:54.

Details

Reviewers
deadalnix
Group Reviewers
Restricted Project
Summary

Fix the OSX cross build:

  • Cleanup the platform file by using CMake built-in features for

sysroot and deployment target.

  • 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 initalized the CMAKE_REQUIRED_FLAGS for
various check_xxx functions such as check_include_file() or
check_symbol_exist(). This fixes the architecture mismatch issue.

  • Add OSX only Qt files (*.mm) to the build.
  • A bug in the CMake files distributed by Qt prevent building with

static OpenGL on OSX (hard linked dependency to the framework in the
Qt5Gui dependencies). To workaround the issue, the static Qt is built
without the OpenGL support.

Depends on D3017

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

Run the generated src/bitcoind and src/qt/bitcoin-qt on OSX >= 10.8
(tested on OSX Sierra 10.12.6).

Diff Detail

Repository
rABC Bitcoin ABC
Branch
cmake_osx
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 5801
Build 9664: Bitcoin ABC Buildbot (legacy)
Build 9663: arc lint + arc unit