mirror of
https://github.com/ByteWelder/Tactility.git
synced 2026-02-18 02:43:15 +00:00
* **New Features** * Centralized module management with global symbol resolution * Level-aware logging with colored prefixes and millisecond timestamps * **Breaking Changes** * ModuleParent hierarchy and getModuleParent() removed * Logging API and adapter model replaced; LogLevel-driven log_generic signature changed * **Improvements** * Unified, simplified module registration across build targets * Tests updated to reflect new module lifecycle and global symbol resolution
30 lines
984 B
CMake
30 lines
984 B
CMake
if (COMMAND tactility_add_module)
|
|
return()
|
|
endif()
|
|
|
|
macro(tactility_add_module NAME)
|
|
set(options)
|
|
set(oneValueArgs)
|
|
set(multiValueArgs SRCS INCLUDE_DIRS PRIV_INCLUDE_DIRS REQUIRES PRIV_REQUIRES)
|
|
cmake_parse_arguments(ARG "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
|
|
|
|
if (DEFINED ENV{ESP_IDF_VERSION})
|
|
idf_component_register(
|
|
SRCS ${ARG_SRCS}
|
|
INCLUDE_DIRS ${ARG_INCLUDE_DIRS}
|
|
PRIV_INCLUDE_DIRS ${ARG_PRIV_INCLUDE_DIRS}
|
|
REQUIRES ${ARG_REQUIRES}
|
|
PRIV_REQUIRES ${ARG_PRIV_REQUIRES}
|
|
)
|
|
else()
|
|
add_library(${NAME} OBJECT)
|
|
target_sources(${NAME} PRIVATE ${ARG_SRCS})
|
|
target_include_directories(${NAME}
|
|
PRIVATE ${ARG_PRIV_INCLUDE_DIRS}
|
|
PUBLIC ${ARG_INCLUDE_DIRS}
|
|
)
|
|
target_link_libraries(${NAME} PUBLIC ${ARG_REQUIRES})
|
|
target_link_libraries(${NAME} PRIVATE ${ARG_PRIV_REQUIRES})
|
|
endif()
|
|
endmacro()
|