A no-op build prints nothing - #338
Merged
Merged
Conversation
One line does it:
set(CMAKE_TARGET_MESSAGES OFF)
It sits above project(), wrapped in a top-level test (this repo has no *_TOP_LEVEL
guard variable of its own), so it applies only when this repo is the top level
project and a consumer that pulls the library in through FetchContent or
add_subdirectory keeps its own "Built target" messages.
Above project(), not after it: CMAKE_TARGET_MESSAGES initializes the TARGET_MESSAGES
global property at the project() call and has no effect if set later -- placed after
project(), a no-op rebuild still printed all 11 lines.
Before / after, on a tree with nothing to do:
$ cmake --build build | wc -l
11 # before
0 # after
A real build is unchanged: it still prints its [ x%] progress lines. Errors are
untouched -- a deliberate syntax error in a source file still fails loudly with the
compiler diagnostic and a non-zero exit (verified, then reverted).
Tests: ./bin/test -> *** ALL TESTS PASS ***
Refs mas-bandwidth/rowan-new#110.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
One line does it:
It sits above project(), wrapped in a top-level test (this repo has no *_TOP_LEVEL
guard variable of its own), so it applies only when this repo is the top level
project and a consumer that pulls the library in through FetchContent or
add_subdirectory keeps its own "Built target" messages.
Above project(), not after it: CMAKE_TARGET_MESSAGES initializes the TARGET_MESSAGES
global property at the project() call and has no effect if set later -- placed after
project(), a no-op rebuild still printed all 11 lines.
Before / after, on a tree with nothing to do:
A real build is unchanged: it still prints its [ x%] progress lines. Errors are
untouched -- a deliberate syntax error in a source file still fails loudly with the
compiler diagnostic and a non-zero exit (verified, then reverted).
Tests: ./bin/test -> *** ALL TESTS PASS ***
Refs mas-bandwidth/rowan-new#110.
Co-Authored-By: Claude Fable 5.1 noreply@anthropic.com