Page MenuHomePhabricator

[CMAKE] Avoid rebuilding sec256k1
ClosedPublic

Authored by Fabien on Nov 29 2019, 16:47.

Details

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 :)

Diff Detail

Repository
rABC Bitcoin ABC
Branch
cmake_fix_secp_rebuild
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 8339
Build 14697: Default Diff Build & Tests
Build 14696: arc lint + arc unit