Skip to content

Make the CMake build target-centric and preset-driven - #59

Merged
rieske merged 1 commit into
masterfrom
build/cmake-idiomatic
Jul 23, 2026
Merged

Make the CMake build target-centric and preset-driven#59
rieske merged 1 commit into
masterfrom
build/cmake-idiomatic

Conversation

@rieske

@rieske rieske commented Jul 23, 2026

Copy link
Copy Markdown
Owner

Summary

  • Replace global CMAKE_CXX_FLAGS* mutation with INTERFACE targets (trans_src, trans_common, trans_coverage) and trans_target_defaults()
  • Fetch GoogleTest only when BUILD_TESTING is on, with URL_HASH pin
  • Add TRANS_ENABLE_COVERAGE option (Makefile maps Debug → ON); add CMakePresets.json (default / debug / coverage / ci)
  • Rename CMake library target codegenbackend (CMP0171 reserved name; source tree stays src/codegen/)
  • Link trans through driver only; set project(... VERSION 0.1.0 ...)
  • Fix Release+-Werror unused variable when assert is compiled out (StackMachine::registerFrameHome)

Test plan

  • cmake --preset coverage (or Debug + TRANS_ENABLE_COVERAGE=ON) build
  • Full ctest (18 tests) green
  • BUILD_TESTING=OFF builds trans without fetching googletest
  • Release build succeeds (assert-only variable fixed)
  • CI: build + test + coverage upload

Replace global CMAKE_CXX_FLAGS mutation with INTERFACE libraries for
includes, warnings/C++20, and optional coverage; fetch GoogleTest only
when testing and pin its tarball hash. Rename the reserved codegen
library target to backend, link the trans executable through driver
alone, and add CMakePresets for release/debug/coverage/ci workflows.
@rieske rieske self-assigned this Jul 23, 2026
@mergify

mergify Bot commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Tick the box to add this pull request to the merge queue (same as @mergifyio queue).

  • Queue this pull request

@coveralls

Copy link
Copy Markdown

Coverage Status

coverage: 91.09%. remained the same — build/cmake-idiomatic into master

@rieske
rieske merged commit 6511204 into master Jul 23, 2026
4 checks passed
@rieske
rieske deleted the build/cmake-idiomatic branch July 23, 2026 14:19
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.

2 participants