Various libraries in this commit use the log headers (that is the direct dependency). The log headers in turn include the T headers (transitive dependency). Building on gracehopper with its many cores triggers the build of these libraries before T headers have been generated. To resolve this and force the generation of T headers before building the libraries, correctly express their dependency on the log headers, which in turn ensures that T headers have been generated. Depending on log_headers is preferrable because it is really the headers that we depend on. Using instead e.g., utils, would trigger build of source files, that we don't need for these libraries. This commit is part of a larger cleanup that I have that is not merged yet. Follow-up work will generalize this in the repo, and ensure that every(!) library builds. We have to add CONFIG_LIB, as the log module has a direct dependency onto the configuration module (it uses it). I am not sure why this was not relevant before.
16 lines
474 B
CMake
16 lines
474 B
CMake
add_library(log_headers INTERFACE)
|
|
target_include_directories(log_headers INTERFACE .)
|
|
target_link_libraries(log_headers INTERFACE T_headers)
|
|
|
|
set(log_sources log.c)
|
|
if (ENABLE_LTTNG)
|
|
set(log_sources ${log_sources} lttng-tp.c)
|
|
endif()
|
|
add_library(LOG ${log_sources})
|
|
target_include_directories(LOG PUBLIC .)
|
|
target_link_libraries(LOG PRIVATE CONFIG_LIB)
|
|
target_link_libraries(LOG PUBLIC log_headers)
|
|
if (ENABLE_LTTNG)
|
|
target_link_libraries(LOG PUBLIC lttng-ust)
|
|
endif()
|