Put T source library in subdirectory, don't build multiple times

- UTIL: has LOG which brings as (public) dependency T, so link it publicly
- Move T to top to ensure all targets can have it
This commit is contained in:
Robert Schmidt
2023-07-13 10:28:38 +02:00
parent c3f8488456
commit 2ae1908339
2 changed files with 20 additions and 39 deletions
+6
View File
@@ -38,3 +38,9 @@ add_custom_target(generate_T DEPENDS T_IDs.h check_vcd)
add_library(T_headers INTERFACE)
add_dependencies(T_headers T_IDs.h T_messages.txt.h)
target_include_directories(T_headers INTERFACE ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR})
if(T_TRACER)
add_library(T STATIC T.c local_tracer.c T_IDs.h T_messages.txt.h)
target_link_libraries(T PUBLIC rt)
target_link_libraries(T PRIVATE CONFIG_LIB T_headers)
endif()