Skip to content

build: modularize CMake configuration - #28

Merged
zuudevs merged 5 commits into
mainfrom
build/modular-cmake
Sep 15, 2026
Merged

zuudevs merged 5 commits into
mainfrom
build/modular-cmake

Conversation

@zuudevs

@zuudevs zuudevs commented Sep 15, 2026

Copy link
Copy Markdown
Owner

Summary

Refactors the CMake build system into a modular, target-scoped structure while preserving library behavior and existing CI/package workflows.

Project identity

  • raises the CMake minimum to 3.21 so PROJECT_IS_TOP_LEVEL is available
  • updates the project version from 0.1.0 to 0.9.0, matching the current development milestone
  • keeps C++17 as a target requirement instead of a global compiler setting

Root orchestration

The root CMakeLists.txt now acts only as an orchestrator:

  • initialize project options
  • initialize target policy
  • add production source
  • conditionally add tests, benchmarks, examples, install/export rules, and developer tools

Modular CMake layout

Adds/normalizes project modules for:

  • options
  • project target settings
  • warnings
  • sanitizers
  • IPO/native optimizations
  • testing
  • benchmarking
  • examples
  • install/export packaging

All project helper functions use the cpp_request_ prefix.

Target cleanup

  • renames the physical production target from generic internal to cpp_request
  • keeps cpp_request::cpp_request as the public build/export target
  • temporarily keeps cpp_request::internal as a compatibility alias
  • warnings, sanitizers, optimization, and clang-tidy are applied directly to project targets and do not leak into the installed target graph

Tests / benchmarks / examples

  • tests/CMakeLists.txt becomes a test source inventory using cpp_request_add_test()
  • benchmark target setup is centralized in cpp_request_add_benchmark()
  • adds cpp_request_add_example() for the upcoming v0.9 examples
  • preserves BUILD_TESTING=OFF compatibility by using an explicitly provided BUILD_TESTING value as the default for CPP_REQUEST_BUILD_TESTS

Packaging

  • moves all install/export logic into cmake/modules/install.cmake
  • moves the package config template to cmake/templates/cpp_requestConfig.cmake.in
  • preserves the installed target cpp_request::cpp_request
  • preserves the install-tree consumer test

Developer tooling

  • namespaced cpp_request_format / cpp_request_format_check targets
  • target-scoped clang-tidy integration
  • fixes Doxygen configuration and generates its Doxyfile into the build tree
  • adds cmake/templates/Doxyfile.in

Source-tree hygiene

Normal CMake configure no longer has any path that generates or rewrites vcpkg.json or other source-controlled files. The old cmake/tools/vcpkg.cmake and unused vcpkg template wiring are removed.

Cleanup

Removes superseded global/legacy modules such as output.cmake, singular warning/sanitizer/optimization modules, and the invalid cmake/templates/CMakeLists.txt wiring.

A cmake/README.md documents the new responsibility boundaries and supported project options.

Scope

This is build-system refactoring only. It does not modify HTTP behavior, public C++ API semantics, response framing, networking, or benchmark definitions.

@zuudevs
zuudevs merged commit 7a1bec1 into main Sep 15, 2026
9 checks passed
@zuudevs
zuudevs deleted the build/modular-cmake branch September 15, 2026 02:23

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f9dd1ddfe1

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread CMakeLists.txt
VERSION ${PROJECT_VERSION}
COMPATIBILITY SameMinorVersion
)
if(CPP_REQUEST_ENABLE_INSTALL)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Skip the package test when install rules are disabled

When CPP_REQUEST_BUILD_TESTS=ON and CPP_REQUEST_ENABLE_INSTALL=OFF—including a subproject that enables tests while retaining the new default of disabled installs—tests/CMakeLists.txt still registers PackageConsumer.InstallAndUse. That test runs cmake --install, then its consumer fails at find_package(cpp_request) because this conditional generated neither the package configuration nor export rules. Guard the package-consumer test with CPP_REQUEST_ENABLE_INSTALL, or prevent this option combination.

Useful? React with 👍 / 👎.

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