Page MenuHomePhabricator

[CMAKE] Always build obj/build.h
ClosedPublic

Authored by Fabien on Sep 19 2019, 12:05.

Details

Summary

The file needs to be always generated.
This requires the use of a custom_target (always out of date) rather
than a custom_command.

Test Plan
mkdir buildcmake && cd buildcmake
cmake -GNinja ..
ninja

Check the buildcmake/obj/build.h file content matches your current
commit hash.
Amend the commit message then run ninja again: the
buildcmake/obj/build.h should be updated accordingly.

Diff Detail

Repository
rABC Bitcoin ABC
Branch
cmake_build_h_always
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 7510
Build 13060: Bitcoin ABC Buildbot (legacy)
Build 13059: arc lint + arc unit

Event Timeline

Fabien planned changes to this revision.Sep 19 2019, 12:09
Fabien edited the summary of this revision. (Show Details)

Simplify things by only keeping the target.

deadalnix requested changes to this revision.Sep 19 2019, 12:38

The dependencies are obviously incorrect (there are none).

This revision now requires changes to proceed.Sep 19 2019, 12:38

Make build_header a dependency to util.

deadalnix requested changes to this revision.Sep 19 2019, 13:40
deadalnix added inline comments.
src/CMakeLists.txt
175 ↗(On Diff #12983)

ALL is not required here.

213 ↗(On Diff #12983)

Have you tried to specify the header as byproduct and then define the header as a depency on util? It is not the role of util to know how this header is generated.

This revision now requires changes to proceed.Sep 19 2019, 13:40
Fabien edited the summary of this revision. (Show Details)

Remove ALL property.

src/CMakeLists.txt
213 ↗(On Diff #12983)

BYPRODUCTS is not supported for setting dependencies if another generator than ninja is used.

This revision is now accepted and ready to land.Sep 19 2019, 17:44
This revision was automatically updated to reflect the committed changes.