Skip to content

Allow selection of subdirectory-scoped 'all' targets when using Makefiles - #48

Open
cresswellp wants to merge 2 commits into
ecmwf:developfrom
cresswellp:feature/expose_makefile2_targets
Open

Allow selection of subdirectory-scoped 'all' targets when using Makefiles#48
cresswellp wants to merge 2 commits into
ecmwf:developfrom
cresswellp:feature/expose_makefile2_targets

Conversation

@cresswellp

Copy link
Copy Markdown
Contributor

Description

CMake gives each new add_subdirectory() call its own all target, for building everything in that scope. When using the Ninja generator we can select these targets as --target=foo/all (foo/bar/all, etc.), but when using Makefiles they're defined in CMakeFiles/Makefile2 and not visible to ecbundle. This change adds the relevant Makefile2 targets to the command list, so they can be selected with either generator. Other types of recursive targets (/clean, /install etc.) remain hidden.

Note that Makefile2 targets don't come with the same [XX%] progress counter that Makefile targets do, as they lack the necessary cmake_progress_start infrastructure. We could fake this within ecbundle itself, but it'd either be progress against the whole build which isn't especially useful (e.g. it'd stop at 20% instead of 100%), or else we can try to set up counters per subproject, but then it's not clear what's being measured if targets spanning multiple subprojects are selected. So I've left this as is (no counter).

A new helper function is used to streamline the new tests, so the existing build tests have been updated to use it too.

Contributor Declaration

By opening this pull request, I affirm the following:

  • All authors agree to the Contributor License Agreement.
  • The code follows the project's coding standards.
  • I have performed self-review and added comments where needed.
  • I have added or updated tests to verify that my changes are effective and functional.
  • I have run all existing tests and confirmed they pass.

@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 49.35%. Comparing base (de8a72c) to head (8cd5ff1).

Additional details and impacted files
@@             Coverage Diff             @@
##           develop      #48      +/-   ##
===========================================
+ Coverage    49.20%   49.35%   +0.14%     
===========================================
  Files           51       51              
  Lines        10385    10409      +24     
===========================================
+ Hits          5110     5137      +27     
+ Misses        5275     5272       -3     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants