Skip to content

A no-op build prints nothing - #338

Merged
rowan-claude merged 1 commit into
mainfrom
quiet-noop-build
Sep 2, 2026
Merged

A no-op build prints nothing#338
rowan-claude merged 1 commit into
mainfrom
quiet-noop-build

Conversation

@rowan-claude

Copy link
Copy Markdown
Contributor

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

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>
@rowan-claude
rowan-claude merged commit 1d16174 into main Sep 2, 2026
14 checks passed
@rowan-claude
rowan-claude deleted the quiet-noop-build branch September 2, 2026 22:17
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.

1 participant