What
Remove the USE_LEGACY_BUILD auto-detection branching from cmake/thread_system_targets.cmake and the submodule fallback path in the root CMakeLists.txt. Commit the project to the single, standard layout (include/kcenon/thread/ + src/).
Part of #683. Depends on sub-issue A (header migration must complete first).
Why
The auto-detection logic exists only to support the dual layout. Once sub-issue A lands, every header lives under include/kcenon/thread/ and every translation unit lives under src/. The branching becomes pure dead weight:
create_thread_system_targets() (cmake/thread_system_targets.cmake:23-92) — runtime detection of include/kcenon/thread and source count
add_legacy_subdirectories() (cmake/thread_system_targets.cmake:97-117) — add_subdirectory for utilities/, interfaces/, core/, implementations/
CMakeLists.txt:188-200 — submodule fallback that still drives add_subdirectory(interfaces) etc.
Removing it lets new contributors read the build script linearly instead of tracing through hybrid-mode escape hatches.
How
- After sub-issue A merges, delete the legacy
interfaces/, utilities/, core/ directories at the repository root (now containing only forwarding stubs and CMakeLists.txt).
- Strip
USE_LEGACY_BUILD PARENT_SCOPE assignments from create_thread_system_targets(). Always create thread_system as the static library from include/kcenon/thread/ + src/.
- Delete the
add_legacy_subdirectories() function and its call site (CMakeLists.txt:153-155).
- Replace the submodule branch (
CMakeLists.txt:188-200) with a single add_library(thread_system STATIC ...) based on the standard layout.
- Drop the
thread_base, utilities, interfaces ALIAS targets if unused, or keep them as pure aliases over thread_system (decide based on grep -rn of dependent repos).
- Run all CMake presets locally:
default, debug, release, core-debug, core-release, asan, tsan, ubsan, ci, vcpkg.
Acceptance Criteria
Where
| Path |
Action |
cmake/thread_system_targets.cmake |
Strip USE_LEGACY_BUILD logic, delete add_legacy_subdirectories |
CMakeLists.txt |
Remove if(USE_LEGACY_BUILD) add_legacy_subdirectories() and submodule legacy branch |
cmake/thread_system_install.cmake |
Audit if(USE_LEGACY_BUILD) guard at line 66 — remove |
interfaces/, utilities/, core/ (root) |
Delete after forwarding stubs no longer referenced |
What
Remove the
USE_LEGACY_BUILDauto-detection branching fromcmake/thread_system_targets.cmakeand the submodule fallback path in the rootCMakeLists.txt. Commit the project to the single, standard layout (include/kcenon/thread/+src/).Part of #683. Depends on sub-issue A (header migration must complete first).
Why
The auto-detection logic exists only to support the dual layout. Once sub-issue A lands, every header lives under
include/kcenon/thread/and every translation unit lives undersrc/. The branching becomes pure dead weight:create_thread_system_targets()(cmake/thread_system_targets.cmake:23-92) — runtime detection ofinclude/kcenon/threadand source countadd_legacy_subdirectories()(cmake/thread_system_targets.cmake:97-117) —add_subdirectoryforutilities/,interfaces/,core/,implementations/CMakeLists.txt:188-200— submodule fallback that still drivesadd_subdirectory(interfaces)etc.Removing it lets new contributors read the build script linearly instead of tracing through hybrid-mode escape hatches.
How
interfaces/,utilities/,core/directories at the repository root (now containing only forwarding stubs and CMakeLists.txt).USE_LEGACY_BUILDPARENT_SCOPE assignments fromcreate_thread_system_targets(). Always createthread_systemas the static library frominclude/kcenon/thread/+src/.add_legacy_subdirectories()function and its call site (CMakeLists.txt:153-155).CMakeLists.txt:188-200) with a singleadd_library(thread_system STATIC ...)based on the standard layout.thread_base,utilities,interfacesALIAS targets if unused, or keep them as pure aliases overthread_system(decide based ongrep -rnof dependent repos).default,debug,release,core-debug,core-release,asan,tsan,ubsan,ci,vcpkg.Acceptance Criteria
cmake/thread_system_targets.cmakecontains a single non-branching target creation pathUSE_LEGACY_BUILDremains in any cmake moduleadd_legacy_subdirectoriesis deletedCMakeLists.txtdoes not calladd_subdirectory(interfaces|utilities|core)Where
cmake/thread_system_targets.cmakeCMakeLists.txtif(USE_LEGACY_BUILD) add_legacy_subdirectories()and submodule legacy branchcmake/thread_system_install.cmakeif(USE_LEGACY_BUILD)guard at line 66 — removeinterfaces/,utilities/,core/(root)