HomePhabricator

[CMAKE] Fix the native build when the target is in the current build dir

Description

[CMAKE] Fix the native build when the target is in the current build dir

Summary:
When the CMAKE_CURRENT_BINARY_DIR is the same than CMAKE_BINARY_DIR,
the computed relative path is empty and the target name starts with a
/, inserting a double slash // in the path at the same time.

This diff fixes the issue by not prepending the relative path to the
target name if it is empty.

Test Plan:
Build bitcoin-abc and secp256k1 standalone.
See Travis result from my secp256k1 repo fork:
https://travis-ci.org/Fabcien/secp256k1/builds/639912900
Depends on D5033 to make Travis happy.

Reviewers: #bitcoin_abc, deadalnix

Reviewed By: #bitcoin_abc, deadalnix

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

Details

Provenance
FabienAuthored on Jan 21 2020, 09:35
FabienPushed on Jan 21 2020, 14:28
Reviewer
Restricted Project
Differential Revision
D5034: [CMAKE] Fix the native build when the target is in the current build dir
Parents
rABC65c1f116deed: [SECP256K1] Use the cmake version from Kitware PPA on Travis
Branches
Unknown
Tags
Unknown