Restructure into umbrella modules (~55 -> 16 targets)
Headers move, CMake targets merge, C++ namespaces stay unchanged: - Core: Scope, Lazy, Counted, Flags, Hash, Bits, Uuid, TypeList, TypeMap, Variant - Functional: Pipeline, Either, Result, Retry - Containers: Ring, Pool, PriorityQueue, LRU, Trie, Graph, DisjointSet, Bitset, Interval - Math: +Matrix, Numeric, Random, Histogram - Text: Str, Format, Tokenizer, Diff, Encoding, Semver - Data: Json, Csv, Ini - Async: Coro, Concurrency, EventBus, Observable - Time: +Bench - Log: Log facade + Logging framework (facade now header-only, breaking the Stacktrace<->Log link cycle the merge would have created) - System: FileSystem + Process - Configuration: +Argparse - Unchanged: Stacktrace, Plugin, StateMachine, Testing, TestingMock, Detail Module system fixes: - OPTIONAL_DEPS resolution deferred to void_finalize_modules() so it no longer depends on the alphabetical discovery order of src/ subdirs (Testing -> Text would have been silently dropped). - Every header-only module now has a tracked module.cmake; previously the empty src/<Name> marker dirs were untracked, so a fresh clone would have silently skipped those modules. - VOID_HAS_LOGGING/CONCURRENCY/STR consumers renamed to LOG/ASYNC/TEXT. Tests move to tests/standalone/<Umbrella>/<Feature>.cpp (Result suite files prefixed: ResultBasic etc.). Test count verified identical (831) before and after. README/CLAUDE.md module tables updated. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
1 parent
da2e93c405
commit
28b94883fd
156 files changed
+278
-220
No files matched your search
+31
-8
@@ -1,5 +1,6 @@
|
||||
set_property(GLOBAL PROPERTY VOID_MODULES "")
|
||||
set_property(GLOBAL PROPERTY VOID_EXT_DEPS "")
|
||||
set_property(GLOBAL PROPERTY VOID_PENDING_OPTIONAL_DEPS "")
|
||||
|
||||
function(void_add_module MODULE_NAME)
|
||||
cmake_parse_arguments(ARG "" ""
|
||||
@@ -46,14 +47,14 @@ function(void_add_module MODULE_NAME)
|
||||
target_link_libraries(${TGT} ${SCOPE} ${PROJECT_NAME}::${int_dep})
|
||||
endforeach()
|
||||
|
||||
get_property(CURRENT_MODULES GLOBAL PROPERTY VOID_MODULES)
|
||||
foreach(opt_dep IN LISTS ARG_OPTIONAL_DEPS)
|
||||
if(${opt_dep} IN_LIST CURRENT_MODULES)
|
||||
target_link_libraries(${TGT} ${SCOPE} ${PROJECT_NAME}::${opt_dep})
|
||||
string(TOUPPER ${opt_dep} UPPER_DEP)
|
||||
target_compile_definitions(${TGT} ${SCOPE} VOID_HAS_${UPPER_DEP})
|
||||
endif()
|
||||
endforeach()
|
||||
# Optional deps are resolved in void_finalize_modules() after every
|
||||
# module has been discovered, so resolution does not depend on the
|
||||
# alphabetical order in which src/ subdirectories are processed.
|
||||
if(ARG_OPTIONAL_DEPS)
|
||||
string(REPLACE ";" "," _opt_list "${ARG_OPTIONAL_DEPS}")
|
||||
set_property(GLOBAL APPEND PROPERTY VOID_PENDING_OPTIONAL_DEPS
|
||||
"${TGT}|${SCOPE}|${_opt_list}")
|
||||
endif()
|
||||
|
||||
if(ARG_EXTERNAL_DEPS)
|
||||
target_link_libraries(${TGT} ${SCOPE} ${ARG_EXTERNAL_DEPS})
|
||||
@@ -138,3 +139,25 @@ function(void_add_module MODULE_NAME)
|
||||
ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}"
|
||||
)
|
||||
endfunction()
|
||||
|
||||
# Resolve OPTIONAL_DEPS recorded by void_add_module(). Must be called once
|
||||
# after all modules have been discovered. Each present dep is linked and
|
||||
# defines VOID_HAS_<UPPERCASE_DEP> on the dependent target.
|
||||
function(void_finalize_modules)
|
||||
get_property(_modules GLOBAL PROPERTY VOID_MODULES)
|
||||
get_property(_pending GLOBAL PROPERTY VOID_PENDING_OPTIONAL_DEPS)
|
||||
foreach(_entry IN LISTS _pending)
|
||||
string(REPLACE "|" ";" _parts "${_entry}")
|
||||
list(GET _parts 0 _tgt)
|
||||
list(GET _parts 1 _scope)
|
||||
list(GET _parts 2 _deps_packed)
|
||||
string(REPLACE "," ";" _deps "${_deps_packed}")
|
||||
foreach(_dep IN LISTS _deps)
|
||||
if(_dep IN_LIST _modules)
|
||||
target_link_libraries(${_tgt} ${_scope} ${PROJECT_NAME}::${_dep})
|
||||
string(TOUPPER ${_dep} _upper)
|
||||
target_compile_definitions(${_tgt} ${_scope} VOID_HAS_${_upper})
|
||||
endif()
|
||||
endforeach()
|
||||
endforeach()
|
||||
endfunction()
|
||||
Reference in new issue
Block a user