HomePhabricator

[CMAKE] Fix the build with Xcode as a generator

Description

[CMAKE] Fix the build with Xcode as a generator

Summary:
Xcode (like Visual Studio) manages build configurations from the IDE and
append this configuration name as a subdirectory for the built targets.
It allows the tools to maintain several configuration builds under the
same tree.

This is causing an issue with native executables, as it becomes
impossible to retrieve the path to the generated native executable.

This diff solves the issue by disabling the subfolder creation for
native executables.
One consequence is that the binary might be overriden on configuration
change. This is unlikely to occur because the configuration is not
passed down when building the native executables, so it should always
fallback to use the same default configuration.

This does not solve all the issues, e.g. the check target still fails
to find the test_bitcoin executable (the target path expansion does
not work since it's wrapped into a shell script). This is left for
another diff.

Depends on D5333.

Test Plan:
Test there is no regression with ninja ...:

cmake -GNinja ..
ninja

... nor make:

cmake -G"Unix Makefiles" ..
make

The build now succeeds with Xcode (run on OSX):

cmake -GXcode ..
cmake --build ${PWD} # No idea how to invoke xcode, but cmake knows !

Run the Gitian builds.

Reviewers: #bitcoin_abc, deadalnix

Reviewed By: #bitcoin_abc, deadalnix

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

Details

Provenance
FabienAuthored on Feb 27 2020, 09:46
FabienPushed on Mar 2 2020, 10:52
Reviewer
Restricted Project
Differential Revision
D5338: [CMAKE] Fix the build with Xcode as a generator
Parents
rABCff651ab013da: revert to deprecated protobuf ByteSize() due to compatibility
Branches
Unknown
Tags
Unknown