Correctly express dependency on LOG headers
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.
This commit is contained in:
@@ -1,10 +1,15 @@
|
|||||||
|
add_library(log_headers INTERFACE)
|
||||||
|
target_include_directories(log_headers INTERFACE .)
|
||||||
|
target_link_libraries(log_headers INTERFACE T_headers)
|
||||||
|
|
||||||
set(log_sources log.c)
|
set(log_sources log.c)
|
||||||
if (ENABLE_LTTNG)
|
if (ENABLE_LTTNG)
|
||||||
set(log_sources ${log_sources} lttng-tp.c)
|
set(log_sources ${log_sources} lttng-tp.c)
|
||||||
endif()
|
endif()
|
||||||
add_library(LOG ${log_sources})
|
add_library(LOG ${log_sources})
|
||||||
target_include_directories(LOG PUBLIC .)
|
target_include_directories(LOG PUBLIC .)
|
||||||
target_link_libraries(LOG PRIVATE ${T_LIB})
|
target_link_libraries(LOG PRIVATE CONFIG_LIB)
|
||||||
|
target_link_libraries(LOG PUBLIC log_headers)
|
||||||
if (ENABLE_LTTNG)
|
if (ENABLE_LTTNG)
|
||||||
target_link_libraries(LOG PUBLIC lttng-ust)
|
target_link_libraries(LOG PUBLIC lttng-ust)
|
||||||
endif()
|
endif()
|
||||||
|
|||||||
@@ -7,6 +7,8 @@ add_library(coding MODULE
|
|||||||
3gpplte_turbo_decoder.c
|
3gpplte_turbo_decoder.c
|
||||||
)
|
)
|
||||||
set_target_properties(coding PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
|
set_target_properties(coding PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
|
||||||
|
#ensure that the T header files are generated before targets depending on them
|
||||||
|
target_link_libraries(coding PRIVATE log_headers)
|
||||||
|
|
||||||
add_library(ldpc_orig MODULE
|
add_library(ldpc_orig MODULE
|
||||||
nrLDPC_decoder/nrLDPC_decoder.c
|
nrLDPC_decoder/nrLDPC_decoder.c
|
||||||
|
|||||||
@@ -4,3 +4,4 @@ add_library(nas_common_ies_lib OBJECT
|
|||||||
)
|
)
|
||||||
|
|
||||||
target_include_directories(nas_common_ies_lib PUBLIC .)
|
target_include_directories(nas_common_ies_lib PUBLIC .)
|
||||||
|
target_link_libraries(nas_common_ies_lib PUBLIC log_headers)
|
||||||
|
|||||||
@@ -2,5 +2,6 @@ add_library(nas_utils OBJECT
|
|||||||
TLVDecoder.c
|
TLVDecoder.c
|
||||||
OctetString.c
|
OctetString.c
|
||||||
)
|
)
|
||||||
|
target_link_libraries(nas_utils PUBLIC log_headers)
|
||||||
|
|
||||||
target_include_directories(nas_utils PRIVATE .)
|
target_include_directories(nas_utils PRIVATE .)
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ add_library(fgs_5gmm_ies_lib OBJECT
|
|||||||
SORTransparentContainer.c
|
SORTransparentContainer.c
|
||||||
)
|
)
|
||||||
|
|
||||||
target_link_libraries(fgs_5gmm_ies_lib PUBLIC
|
target_link_libraries(fgs_5gmm_ies_lib
|
||||||
nas_common_ies_lib
|
PUBLIC nas_common_ies_lib
|
||||||
|
PRIVATE log_headers
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
add_library(fgs_5gsm_lib OBJECT PduSessionEstablishRequest.c
|
add_library(fgs_5gsm_lib OBJECT PduSessionEstablishRequest.c
|
||||||
PduSessionEstablishmentAccept.c)
|
PduSessionEstablishmentAccept.c)
|
||||||
|
|
||||||
target_link_libraries(fgs_5gsm_lib PUBLIC nas_common_ies_lib)
|
target_link_libraries(fgs_5gsm_lib PUBLIC nas_common_ies_lib log_headers)
|
||||||
|
|
||||||
target_include_directories(fgs_5gsm_lib PUBLIC . ../../)
|
target_include_directories(fgs_5gsm_lib PUBLIC . ../../)
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ add_library(usim_lib OBJECT
|
|||||||
aka_functions.c
|
aka_functions.c
|
||||||
usim_api.c
|
usim_api.c
|
||||||
)
|
)
|
||||||
|
target_link_libraries(usim_lib PRIVATE log_headers)
|
||||||
|
|
||||||
target_include_directories(usim_lib PUBLIC
|
target_include_directories(usim_lib PUBLIC
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}
|
${CMAKE_CURRENT_SOURCE_DIR}
|
||||||
|
|||||||
@@ -1,2 +1,3 @@
|
|||||||
add_library(lib_uicc OBJECT usim_interface.c)
|
add_library(lib_uicc OBJECT usim_interface.c)
|
||||||
target_include_directories(lib_uicc PRIVATE .)
|
target_include_directories(lib_uicc PRIVATE .)
|
||||||
|
target_link_libraries(lib_uicc PRIVATE log_headers)
|
||||||
|
|||||||
Reference in New Issue
Block a user