HomePhabricator

[CMAKE] Avoid rebuilding sec256k1

Description

[CMAKE] Avoid rebuilding sec256k1

Summary:
Running multiple consecutive builds on any target that depends on
secp256k1 will trigger a rebuild of the library once every 2 calls.

The reason for this is that the gen_context utility is producing the
ecmult_static_context.h file under the src directory, but the custom
command expects the output in the current binary directory which is a
level above. The custom command ends up running everytime to try
regenerating the output, which in turns cause secp256k1 to rebuild as
the header is modified.

Test Plan:

ninja bitcoind

Then:

time for i in {1..10}; do ninja bitcoind; done

Enjoy :)

Reviewers: #bitcoin_abc, deadalnix

Reviewed By: #bitcoin_abc, deadalnix

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

Details

Provenance
FabienAuthored on Nov 29 2019, 16:46
FabienPushed on Dec 2 2019, 07:39
Reviewer
Restricted Project
Differential Revision
D4587: [CMAKE] Avoid rebuilding sec256k1
Parents
rABC3a12c8538e5b: [CMAKE] Fix scope issue in the remove_<lang>_compiler_flags() functions
Branches
Unknown
Tags
Unknown