Skip to content

build: an option per component, cth links boost-pfr - #16

Merged
codethinki merged 2 commits into
masterfrom
feat/component-options
Oct 18, 2026
Merged

codethinki merged 2 commits into
masterfrom
feat/component-options

Conversation

@codethinki

Copy link
Copy Markdown
Owner

Summary

  • Every component behind an option through cth_add_subdirectory (cth_cmake#7): CTH_BUILD_OS, CTH_BUILD_CORO, CTH_BUILD_NET (default ON) and CTH_BUILD_WIN (default WIN32). A parent project turns components off with set(CTH_BUILD_<COMPONENT> OFF) before add_subdirectory(cth); the package only contains the built components.
  • The components assert what they need: coro and net need cth_os, cth_win needs cth_os, cth_coro and a windows target.
  • fix: the cth target links boost-pfr. cth/hash/hash_aggregates.hpp includes boost/pfr.hpp, but neither the target nor the package declared it, consumers had to find boost_pfr themselves.
  • README: subdirectory usage, the options, the missing net component.
  • Bumps lib/cth_cmake to 09a6c5d (refactor(data): remove the virtual destructor of raw_poly_vector #6, build: link stdc++exp through a generator expression #7).

For cth_engine, which adds cth from a submodule with coro, net and win off.

Test plan

  • gcc debug, all components: 264/264
  • gcc debug, CTH_BUILD_NET=OFF CTH_BUILD_CORO=OFF: 192/192, installed package only has cth and os
  • CTH_BUILD_OS=OFF with coro on fails the configure with the assert
  • cth_engine with add_subdirectory(lib/cth): 273/273 on gcc and clang, no install on build
  • CI: Linux gcc/clang, Windows msvc/clang

CTH_BUILD_OS, CTH_BUILD_CORO, CTH_BUILD_NET (default ON) and CTH_BUILD_WIN (default WIN32) through
cth_add_subdirectory, a parent project turns components off before add_subdirectory(cth). The
components assert the components they need, cth_win that it targets windows.
Bumps lib/cth_cmake for cth_add_subdirectory.
cth/hash/hash_aggregates.hpp includes boost/pfr.hpp, the cth target and the package did not
declare the dependency. Consumers had to find boost_pfr themselves.
@codethinki
codethinki merged commit 9fb6cb6 into master Oct 18, 2026
6 checks passed
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