From f9a8fc62e9c22e43e9ed48778ed5bdff1a506b73 Mon Sep 17 00:00:00 2001 From: flonics-claude Date: Sun, 31 May 2026 01:35:14 +0900 Subject: [PATCH 1/2] refactor(build): fix install export paths to existing headers The header install step referenced directories that do not exist in the tree: interfaces/ and implementations/{thread_pool,typed_thread_pool, lockfree}/include/. Those dangling install(DIRECTORY ...) entries left the install/export surface inconsistent and undermined find_package(thread_system) (issue #696). Replace them with rules that target the real layout: - install the canonical public API from include/ recursively, now also matching *.hpp and *.tpp (template implementations) so headers like the typed_thread_pool .tpp files are exported, not just .h; - install the legacy forwarding-stub headers that still exist (core/base/include, core/sync/include, utilities/include) flat into the include prefix so old flat #include names keep resolving during the EPIC #683 deprecation window, each guarded by EXISTS. Refs #696 --- cmake/thread_system_install.cmake | 79 +++++++++++++++---------------- 1 file changed, 39 insertions(+), 40 deletions(-) diff --git a/cmake/thread_system_install.cmake b/cmake/thread_system_install.cmake index c401c1943c..209763e43e 100644 --- a/cmake/thread_system_install.cmake +++ b/cmake/thread_system_install.cmake @@ -12,49 +12,48 @@ include(CMakePackageConfigHelpers) # Install headers ################################################## function(install_thread_system_headers) - # Install headers from new structure + # Canonical headers. The whole public API lives under + # include/kcenon/thread/... in the current layout, so a single recursive + # rule installs every header (core, interfaces, utils, lockfree, + # implementation details, etc.) to /include/kcenon/thread/... + # *.tpp template implementation files are installed alongside the headers + # they back (e.g. typed_thread_pool), which the previous per-component + # rules only handled for one module. install(DIRECTORY include/ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} COMPONENT Development - FILES_MATCHING PATTERN "*.h") - - # Install legacy interfaces for backward compatibility - if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/interfaces) - install(DIRECTORY interfaces/ - DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/thread_system/interfaces - COMPONENT Development - FILES_MATCHING PATTERN "*.h") - endif() - - # Utility headers - if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/utilities/include) - install(DIRECTORY utilities/include/ - DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/thread_system/utilities - COMPONENT Development - FILES_MATCHING PATTERN "*.h") - endif() - - # Implementation headers - if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/implementations/thread_pool/include) - install(DIRECTORY implementations/thread_pool/include/ - DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/thread_system/implementations/thread_pool - COMPONENT Implementation - FILES_MATCHING PATTERN "*.h") - endif() - - if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/implementations/typed_thread_pool/include) - install(DIRECTORY implementations/typed_thread_pool/include/ - DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/thread_system/implementations/typed_thread_pool - COMPONENT Implementation - FILES_MATCHING PATTERN "*.h" PATTERN "*.tpp") - endif() - - if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/implementations/lockfree/include) - install(DIRECTORY implementations/lockfree/include/ - DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/thread_system/implementations/lockfree - COMPONENT Implementation - FILES_MATCHING PATTERN "*.h") - endif() + FILES_MATCHING + PATTERN "*.h" + PATTERN "*.hpp" + PATTERN "*.tpp") + + # Legacy forwarding-stub headers (EPIC #683 deprecation window). These are + # thin shims such as core/base/include/thread_base.h that #include the + # canonical header, kept so that downstream code using + # the old flat include names keeps compiling for one release. They are + # installed flat into /include so that #include "thread_base.h" + # style usage still resolves. Each rule is guarded by EXISTS so it becomes + # a no-op once the stubs are removed. + # + # NOTE: the previously referenced interfaces/ and + # implementations/{thread_pool,typed_thread_pool,lockfree}/include/ + # directories do not exist in this tree. Those dangling install(DIRECTORY) + # entries are removed here because their canonical headers are already + # covered by the include/ rule above; leaving them broke the audit of the + # install/export surface (issue #696). + foreach(_legacy_inc + core/base/include + core/sync/include + utilities/include) + if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${_legacy_inc}) + install(DIRECTORY ${_legacy_inc}/ + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} + COMPONENT Development + FILES_MATCHING + PATTERN "*.h" + PATTERN "*.hpp") + endif() + endforeach() message(STATUS "Configured header installation") endfunction() From a3313eca6f207d9759a2251eb23c44dfdd9c1e72 Mon Sep 17 00:00:00 2001 From: flonics-claude Date: Sun, 31 May 2026 01:36:09 +0900 Subject: [PATCH 2/2] refactor(build): add thread_pool/typed_thread_pool target aliases In-tree tests and examples link against the targets thread_pool and typed_thread_pool, but create_thread_system_targets() only aliased thread_base, utilities and interfaces to the unified thread_system library. A clean configure with tests enabled therefore failed with "target thread_pool not found". Add additive ALIAS targets for thread_pool and typed_thread_pool so the in-tree target graph matches the installed export, which already exposes thread_system::thread_pool and thread_system::typed_thread_pool through thread_system-config.cmake.in. Refs #696 --- cmake/thread_system_targets.cmake | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/cmake/thread_system_targets.cmake b/cmake/thread_system_targets.cmake index cd8c9683ca..ce5e00c552 100644 --- a/cmake/thread_system_targets.cmake +++ b/cmake/thread_system_targets.cmake @@ -52,7 +52,16 @@ function(create_thread_system_targets) # tests) that still link against the legacy target names. The forwarding # header stubs in utilities/include/ and core/{sync,base}/include/ remain # in place for one release per the EPIC #683 deprecation policy. + # thread_pool / typed_thread_pool are included because in-tree tests and + # examples link against those names while only thread_base/utilities/ + # interfaces were aliased before, so a clean configure with tests enabled + # failed with "target thread_pool not found". The installed package already + # exposes thread_system::thread_pool and thread_system::typed_thread_pool via + # thread_system-config.cmake.in, so these aliases make the in-tree target + # graph match the exported one (issue #696). add_library(thread_base ALIAS thread_system) + add_library(thread_pool ALIAS thread_system) + add_library(typed_thread_pool ALIAS thread_system) add_library(utilities ALIAS thread_system) add_library(interfaces ALIAS thread_system) @@ -72,7 +81,7 @@ function(create_thread_system_targets) message(STATUS "thread_system: simdutf support enabled") endif() - message(STATUS "Created thread_system library target with legacy aliases (thread_base, utilities, interfaces)") + message(STATUS "Created thread_system library target with legacy aliases (thread_base, thread_pool, typed_thread_pool, utilities, interfaces)") endfunction() ##################################################