HomePhabricator

[SECP256K1] CMake: Fix in-tree build

Description

[SECP256K1] CMake: Fix in-tree build

Summary:
The in-tree build is broken when building with CMake.
This is because the "standard" CMake call pattern has a dual meaning
depending on the context: the path argument is eigher the source root
(which is what we want) OR the build root if a build already exists
in this path.
This second case occurs when building in-tree as the source root is also
the build root; as a consequence when configuring the native executables
to generate the build tree to the native directory, the root build
files are updated instead.

Macro notabug:

This diff fixes the issue by specifiying both the source root and build
root when calling CMake to configure the native executables. The build
directory is created by CMake if needed, so the initial mkdir becomes
useless and is removed.

Test Plan: Build the secp256k1 project both in-tree and out-of-tree.

Reviewers: #bitcoin_abc, deadalnix

Reviewed By: #bitcoin_abc, deadalnix

Subscribers: deadalnix

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

Details

Provenance
FabienAuthored on Jan 29 2020, 07:46
nakihitoPushed on Jan 29 2020, 20:57
Reviewer
Restricted Project
Differential Revision
D5097: [SECP256K1] CMake: Fix in-tree build
Parents
rSTAGING977b18b8f2fe: [SECP256K1] Travis: pass extra flags to the CMake build
Branches
Unknown
Tags
Unknown