Page MenuHomePhabricator

[CMAKE] Fix CMake cross build for OSX
Needs RevisionPublic

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


Group Reviewers
Restricted Project

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

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

Diff Detail

rABC Bitcoin ABC
Lint OK
No Unit Test Coverage
Build Status
Buildable 5801
Build 9664: Bitcoin ABC Teamcity Staging
Build 9663: arc lint + arc unit

Event Timeline

Fabien created this revision.Fri, May 10, 11:54
Herald added a reviewer: Restricted Project. · View Herald TranscriptFri, May 10, 11:54
deadalnix requested changes to this revision.Sun, May 12, 23:13

It is clear you are aware this patches does many things at once, because you enumerate them in the description.

This revision now requires changes to proceed.Sun, May 12, 23:13