Page MenuHomePhabricator

[CMAKE] Fix CMake cross build for OSX

Authored by Fabien on May 10 2019, 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 Buildbot (legacy)
Build 9663: arc lint + arc unit

Event Timeline

Fabien created this revision.May 10 2019, 11:54
Herald added a reviewer: Restricted Project. · View Herald TranscriptMay 10 2019, 11:54
deadalnix requested changes to this revision.May 12 2019, 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.May 12 2019, 23:13
Fabien abandoned this revision.May 25 2019, 07:15

Superseded by D3031, D3032, D3033 and D3034