Skip to content

A no-op build prints nothing - #182

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

A no-op build prints nothing#182
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 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

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