From be4461ccca3b9c8868839c8de72850f5f52954bd Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Thu, 12 Feb 2026 06:19:19 +0100 Subject: [PATCH] Move GTPV1U cmake code to subdirectory Move the module cmake code to its subdirectory for better organization, and remove superfluous include_directories() that are not recommended to be used (as it populates all other targets with those directories, most of which don't need it anyway). Slightly clean up the module by removing headers to unused dependencies. The GTP module has a dependency to 4G and 5G RLC, which should not exist (the RLC modules have a dependency on GTP, not the other way around), but in this commit, make as little modifications as possible. --- CMakeLists.txt | 9 --------- openair2/E1AP/CMakeLists.txt | 2 +- openair3/CMakeLists.txt | 1 + openair3/ocp-gtpu/CMakeLists.txt | 4 ++++ openair3/ocp-gtpu/gtp_itf.cpp | 14 +++++++------- 5 files changed, 13 insertions(+), 17 deletions(-) create mode 100644 openair3/ocp-gtpu/CMakeLists.txt diff --git a/CMakeLists.txt b/CMakeLists.txt index 7dee45a453..ad70a1b53e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -595,7 +595,6 @@ include_directories("${OPENAIR3_DIR}/S1AP") include_directories("${OPENAIR2_DIR}/X2AP") include_directories("${OPENAIR2_DIR}/M2AP") include_directories("${OPENAIR2_DIR}/F1AP") -include_directories("${OPENAIR3_DIR}/ocp-gtpu") include_directories("${OPENAIR3_DIR}/M3AP") include_directories("${OPENAIR3_DIR}/MME_APP") include_directories("${OPENAIR_DIR}/radio/COMMON") @@ -1381,14 +1380,6 @@ include_directories("${OPENAIR1_DIR}/SCHED_NR_UE") # CN libs ########################## -add_library (GTPV1U - ${OPENAIR3_DIR}/ocp-gtpu/gtp_itf.cpp - ${OPENAIR3_DIR}/ocp-gtpu/gtpu_extensions.c - ) -target_link_libraries(GTPV1U PRIVATE asn1_nr_rrc_hdrs asn1_lte_rrc_hdrs) -target_link_libraries(GTPV1U PRIVATE SIMU ds) -include_directories(${OPENAIR3_DIR}/ocp-gtp) - set (MME_APP_SRC ${OPENAIR3_DIR}/MME_APP/mme_app.c ${OPENAIR3_DIR}/MME_APP/mme_config.c diff --git a/openair2/E1AP/CMakeLists.txt b/openair2/E1AP/CMakeLists.txt index eb3bd0f546..39b768ffc3 100644 --- a/openair2/E1AP/CMakeLists.txt +++ b/openair2/E1AP/CMakeLists.txt @@ -4,7 +4,7 @@ add_subdirectory(lib) add_library(e1ap e1ap.c e1ap_common.c) target_link_libraries(e1ap PUBLIC asn1_e1ap e1ap_lib - PRIVATE asn1_nr_rrc_hdrs asn1_lte_rrc_hdrs asn1_f1ap UTIL e1_if) + PRIVATE asn1_nr_rrc_hdrs asn1_lte_rrc_hdrs asn1_f1ap UTIL e1_if GTPV1U) target_include_directories(e1ap PUBLIC ${CMAKE_CURRENT_DIR}) if(ENABLE_TESTS) diff --git a/openair3/CMakeLists.txt b/openair3/CMakeLists.txt index 55f9fe91d6..706d343f56 100644 --- a/openair3/CMakeLists.txt +++ b/openair3/CMakeLists.txt @@ -1,4 +1,5 @@ add_subdirectory(LPP) +add_subdirectory(ocp-gtpu) add_subdirectory(M3AP) add_subdirectory(S1AP) add_subdirectory(NAS) diff --git a/openair3/ocp-gtpu/CMakeLists.txt b/openair3/ocp-gtpu/CMakeLists.txt new file mode 100644 index 0000000000..bcb76e98c9 --- /dev/null +++ b/openair3/ocp-gtpu/CMakeLists.txt @@ -0,0 +1,4 @@ +add_library (GTPV1U gtp_itf.cpp gtpu_extensions.c) +target_link_libraries(GTPV1U PRIVATE asn1_lte_rrc_hdrs asn1_nr_rrc_hdrs) # for ITTI +target_link_libraries(GTPV1U PRIVATE SIMU ds) +target_include_directories(GTPV1U PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) diff --git a/openair3/ocp-gtpu/gtp_itf.cpp b/openair3/ocp-gtpu/gtp_itf.cpp index 6650439e81..9509c5a8a4 100644 --- a/openair3/ocp-gtpu/gtp_itf.cpp +++ b/openair3/ocp-gtpu/gtp_itf.cpp @@ -15,15 +15,15 @@ extern "C" { #include #include "common/utils/LOG/log.h" #include -#include -#include -#include -#include -#include -#include "openair2/SDAP/nr_sdap/nr_sdap.h" -#include "openair3/ocp-gtpu/gtpu_extensions.h" #include "sim.h" +// TODO these dependencies should not exist and be removed +#include "openair2/LAYER2/nr_rlc/nr_rlc_oai_api.h" +#include "openair2/LAYER2/RLC/rlc.h" + +#include "gtp_itf.h" +#include "gtpu_extensions.h" + #pragma pack(1) typedef struct Gtpv1uMsgHeader {