A no-op build prints nothing - #182
Merged
Merged
Conversation
One line does it:
set(CMAKE_TARGET_MESSAGES OFF)
It sits above project(), wrapped in the same top-level test the NETCODE_TOP_LEVEL
guard uses, 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 inside the existing top-level branch: CMAKE_TARGET_MESSAGES
initializes the TARGET_MESSAGES global property at the project() call and has no
effect if set after it. Placed inside the branch, a no-op rebuild still printed all
8 lines -- which is why the line carries its own guard rather than joining the one
below.
Before / after, on a tree with nothing to do:
$ cmake --build build | wc -l
8 # 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: ctest --test-dir build --output-on-failure -> 100% tests passed out of 1
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 the same top-level test the NETCODE_TOP_LEVEL
guard uses, 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 inside the existing top-level branch: CMAKE_TARGET_MESSAGES
initializes the TARGET_MESSAGES global property at the project() call and has no
effect if set after it. Placed inside the branch, a no-op rebuild still printed all
8 lines -- which is why the line carries its own guard rather than joining the one
below.
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: ctest --test-dir build --output-on-failure -> 100% tests passed out of 1
Refs mas-bandwidth/rowan-new#110.
Co-Authored-By: Claude Fable 5.1 noreply@anthropic.com