Page MenuHomePhabricator

[CMAKE] Avoid rebuilding sec256k1

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


Group Reviewers
Restricted Project
rABCc4345d49c203: [CMAKE] Avoid rebuilding sec256k1

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


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

Enjoy :)

Diff Detail

rABC Bitcoin ABC
Automatic diff as part of commit; lint not applicable.
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

Fabien created this revision.Fri, Nov 29, 16:47
Herald added a reviewer: Restricted Project. · View Herald TranscriptFri, Nov 29, 16:47
deadalnix accepted this revision.Sat, Nov 30, 17:54

Cool, I was wondering WTF was up with this one.

This revision is now accepted and ready to land.Sat, Nov 30, 17:54
This revision was automatically updated to reflect the committed changes.