Commit 1d16174
A no-op build prints nothing (rowan-new#110) (#338)
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>1 parent 3be987b commit 1d16174
1 file changed
Lines changed: 11 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
17 | 28 | | |
18 | 29 | | |
19 | 30 | | |
| |||
0 commit comments