Commit 3b7d6377 authored by Robert Schmidt's avatar Robert Schmidt

Link targets that need RRC ASN.1 headers to header-only library

Most targets don't need the symbols from the compiled RRC ASN.1
libraries, but only the headers. In particular when compiling individual
libraries (e.g., for tests), linking the full library makes the RRC
ASN.1 libraries compile and link, when they are not needed (only headers
are needed).

For libraries that can do without these headers, don't link them.
parent 6cd72e4e
This diff is collapsed.
...@@ -35,7 +35,7 @@ add_library(telnetsrv MODULE ...@@ -35,7 +35,7 @@ add_library(telnetsrv MODULE
telnetsrv_measurements.c telnetsrv_measurements.c
) )
target_link_libraries(telnetsrv PRIVATE history) target_link_libraries(telnetsrv PRIVATE history)
target_link_libraries(telnetsrv PRIVATE asn1_nr_rrc asn1_lte_rrc) target_link_libraries(telnetsrv PRIVATE asn1_nr_rrc_hdrs asn1_lte_rrc_hdrs)
message(STATUS "Add enb specific telnet functions in libtelnetsrv_enb.so") message(STATUS "Add enb specific telnet functions in libtelnetsrv_enb.so")
add_library(telnetsrv_enb MODULE add_library(telnetsrv_enb MODULE
...@@ -43,7 +43,7 @@ add_library(telnetsrv_enb MODULE ...@@ -43,7 +43,7 @@ add_library(telnetsrv_enb MODULE
telnetsrv_enb_phycmd.c telnetsrv_enb_phycmd.c
) )
add_dependencies(telnetsrv telnetsrv_enb) add_dependencies(telnetsrv telnetsrv_enb)
target_link_libraries(telnetsrv_enb PRIVATE asn1_nr_rrc asn1_lte_rrc) target_link_libraries(telnetsrv_enb PRIVATE asn1_nr_rrc_hdrs asn1_lte_rrc_hdrs)
message(STATUS "No specific telnet functions for gnb") message(STATUS "No specific telnet functions for gnb")
...@@ -52,7 +52,7 @@ message(STATUS "No specific telnet functions for 4Gue") ...@@ -52,7 +52,7 @@ message(STATUS "No specific telnet functions for 4Gue")
message(STATUS "Add 5Gue specific telnet functions in libtelnetsrv_5Gue.so") message(STATUS "Add 5Gue specific telnet functions in libtelnetsrv_5Gue.so")
add_library(telnetsrv_5Gue MODULE telnetsrv_5Gue_measurements.c) add_library(telnetsrv_5Gue MODULE telnetsrv_5Gue_measurements.c)
add_dependencies(telnetsrv telnetsrv_5Gue) add_dependencies(telnetsrv telnetsrv_5Gue)
target_link_libraries(telnetsrv_5Gue PRIVATE asn1_nr_rrc asn1_lte_rrc) target_link_libraries(telnetsrv_5Gue PRIVATE asn1_nr_rrc_hdrs asn1_lte_rrc_hdrs)
# all libraries should be written to root build dir # all libraries should be written to root build dir
set_target_properties(telnetsrv telnetsrv_enb telnetsrv_5Gue set_target_properties(telnetsrv telnetsrv_enb telnetsrv_5Gue
......
...@@ -62,7 +62,6 @@ add_library(websrv MODULE ...@@ -62,7 +62,6 @@ add_library(websrv MODULE
websrv_utils.c websrv_utils.c
../../../openair1/PHY/TOOLS/nr_phy_scope.c ../../../openair1/PHY/TOOLS/nr_phy_scope.c
) )
target_link_libraries(websrv PRIVATE asn1_lte_rrc asn1_nr_rrc)
target_link_libraries(websrv PRIVATE ulfius jansson) target_link_libraries(websrv PRIVATE ulfius jansson)
target_compile_definitions(websrv PUBLIC WEBSRVSCOPE) target_compile_definitions(websrv PUBLIC WEBSRVSCOPE)
# put websrv into build root and not under build/common/utils/websrv/ # put websrv into build root and not under build/common/utils/websrv/
......
...@@ -33,16 +33,16 @@ include_directories ("/usr/include/X11") ...@@ -33,16 +33,16 @@ include_directories ("/usr/include/X11")
add_library(xforms_common OBJECT add_library(xforms_common OBJECT
lte_phy_scope.c lte_phy_scope.c
../../../executables/stats.c) ../../../executables/stats.c)
target_link_libraries(xforms_common PRIVATE asn1_nr_rrc PRIVATE asn1_lte_rrc) target_link_libraries(xforms_common PRIVATE asn1_nr_rrc_hdrs asn1_lte_rrc_hdrs)
add_library(enbscope MODULE lte_enb_scope.c $<TARGET_OBJECTS:xforms_common>) add_library(enbscope MODULE lte_enb_scope.c $<TARGET_OBJECTS:xforms_common>)
target_link_libraries(enbscope PUBLIC forms PRIVATE asn1_nr_rrc PRIVATE asn1_lte_rrc) target_link_libraries(enbscope PUBLIC forms PRIVATE asn1_nr_rrc_hdrs asn1_lte_rrc_hdrs)
add_library(uescope MODULE lte_ue_scope.c $<TARGET_OBJECTS:xforms_common>) add_library(uescope MODULE lte_ue_scope.c $<TARGET_OBJECTS:xforms_common>)
target_link_libraries(uescope PUBLIC forms PRIVATE asn1_nr_rrc PRIVATE asn1_lte_rrc) target_link_libraries(uescope PUBLIC forms PRIVATE asn1_nr_rrc_hdrs asn1_lte_rrc_hdrs)
add_library(nrscope MODULE nr_phy_scope.c) add_library(nrscope MODULE nr_phy_scope.c)
target_link_libraries(nrscope PUBLIC forms PRIVATE asn1_nr_rrc PRIVATE asn1_lte_rrc) target_link_libraries(nrscope PUBLIC forms PRIVATE asn1_nr_rrc_hdrs asn1_lte_rrc_hdrs)
# all libraries should be written to root build dir (default creates the same hierarchie under build as existing for sources) # all libraries should be written to root build dir (default creates the same hierarchie under build as existing for sources)
set_target_properties(enbscope uescope nrscope set_target_properties(enbscope uescope nrscope
......
...@@ -33,13 +33,11 @@ ...@@ -33,13 +33,11 @@
#include "PHY/phy_extern.h" #include "PHY/phy_extern.h"
#include "PHY/phy_extern_ue.h" #include "PHY/phy_extern_ue.h"
#include "LAYER2/MAC/mac.h"
#include "LAYER2/MAC/mac_extern.h"
#include "common/utils/LOG/log.h" #include "common/utils/LOG/log.h"
#include "RRC/LTE/rrc_extern.h"
#include "PHY_INTERFACE/phy_interface_extern.h" #include "PHY_INTERFACE/phy_interface_extern.h"
#include "UTIL/OCG/OCG.h" #include "UTIL/OCG/OCG.h"
#include "UTIL/OPT/opt.h" // to test OPT #include "UTIL/OPT/opt.h" // to test OPT
#include "common/ran_context.h"
#define RF #define RF
......
...@@ -3,5 +3,5 @@ add_subdirectory(MESSAGES) ...@@ -3,5 +3,5 @@ add_subdirectory(MESSAGES)
add_library(e1ap e1ap.c e1ap_common.c e1ap_api.c) add_library(e1ap e1ap.c e1ap_common.c e1ap_api.c)
target_link_libraries(e1ap target_link_libraries(e1ap
PUBLIC asn1_e1ap f1ap PUBLIC asn1_e1ap f1ap
PRIVATE asn1_nr_rrc asn1_lte_rrc asn1_f1ap UTIL e1_pdcp_if e1_if) PRIVATE asn1_nr_rrc_hdrs asn1_lte_rrc_hdrs asn1_f1ap UTIL e1_pdcp_if e1_if)
target_include_directories(e1ap PUBLIC ${CMAKE_CURRENT_DIR}) target_include_directories(e1ap PUBLIC ${CMAKE_CURRENT_DIR})
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment