Commit 60bc5397 authored by Robert Schmidt's avatar Robert Schmidt

Generate and build NR RRC ASN.1 during build time

parent 2e6a1c36
This diff is collapsed.
...@@ -9,6 +9,7 @@ set(TELNETSRV_SOURCE ...@@ -9,6 +9,7 @@ set(TELNETSRV_SOURCE
add_library(telnetsrv MODULE ${TELNETSRV_SOURCE} ) add_library(telnetsrv MODULE ${TELNETSRV_SOURCE} )
target_link_libraries(telnetsrv PRIVATE history ncurses form ) target_link_libraries(telnetsrv PRIVATE history ncurses form )
target_link_libraries(telnetsrv PRIVATE asn1_nr_rrc)
foreach(TELNETLIB enb gnb 4Gue 5Gue) foreach(TELNETLIB enb gnb 4Gue 5Gue)
set(TELNETLIB_SRCS "") set(TELNETLIB_SRCS "")
...@@ -22,6 +23,7 @@ foreach(TELNETLIB enb gnb 4Gue 5Gue) ...@@ -22,6 +23,7 @@ foreach(TELNETLIB enb gnb 4Gue 5Gue)
message("Add ${TELNETLIB} specific telnet functions in libtelnetsrv_${TELNETLIB}.so") message("Add ${TELNETLIB} specific telnet functions in libtelnetsrv_${TELNETLIB}.so")
add_library(telnetsrv_${TELNETLIB} MODULE ${TELNETLIB_SRCS} ) add_library(telnetsrv_${TELNETLIB} MODULE ${TELNETLIB_SRCS} )
add_dependencies(telnetsrv telnetsrv_${TELNETLIB}) add_dependencies(telnetsrv telnetsrv_${TELNETLIB})
target_link_libraries(telnetsrv_${TELNETLIB} PRIVATE asn1_nr_rrc)
install(TARGETS telnetsrv_${TELNETLIB} DESTINATION bin) install(TARGETS telnetsrv_${TELNETLIB} DESTINATION bin)
else() else()
message("No specific telnet functions for ${TELNETLIB}") message("No specific telnet functions for ${TELNETLIB}")
......
add_subdirectory(E1AP) add_subdirectory(E1AP)
add_subdirectory(F1AP) add_subdirectory(F1AP)
add_subdirectory(X2AP) add_subdirectory(X2AP)
add_subdirectory(RRC)
...@@ -3,5 +3,5 @@ add_subdirectory(MESSAGES) ...@@ -3,5 +3,5 @@ add_subdirectory(MESSAGES)
add_library(E1AP e1ap.c) add_library(E1AP e1ap.c)
target_link_libraries(E1AP target_link_libraries(E1AP
PUBLIC asn1_e1ap PUBLIC asn1_e1ap
PRIVATE UTIL) PRIVATE UTIL asn1_nr_rrc)
target_include_directories(E1AP PUBLIC ${CMAKE_CURRENT_DIR}) target_include_directories(E1AP PUBLIC ${CMAKE_CURRENT_DIR})
add_subdirectory(NR)
add_subdirectory(MESSAGES)
This diff is collapsed.
set(NR_RRC_VERSION 16 4 1)
make_version(NR_RRC_cc ${NR_RRC_VERSION})
string(REPLACE ";" "." NR_RRC_RELEASE "${NR_RRC_VERSION}")
if(NR_RRC_RELEASE VERSION_EQUAL "16.4.1")
include(ASN.1/nr-rrc-16.4.1.cmake)
else()
message(FATAL_ERROR "unknown NR_RRC_RELEASE ${NR_RRC_RELEASE}")
endif()
add_custom_command(OUTPUT ${nr_rrc_source} ${nr_rrc_headers}
COMMAND ASN1C_PREFIX=NR_ asn1c -pdu=all -fcompound-names -gen-PER -no-gen-OER -no-gen-example -findirect-choice -D ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/${NR_RRC_GRAMMAR}
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${NR_RRC_GRAMMAR}
COMMENT "Generating NR RRC source file from ${CMAKE_CURRENT_SOURCE_DIR}/${NR_RRC_GRAMMAR}"
)
add_library(asn1_nr_rrc ${nr_rrc_source})
target_include_directories(asn1_nr_rrc PUBLIC "${CMAKE_CURRENT_BINARY_DIR}")
target_compile_options(asn1_nr_rrc
PRIVATE -DASN_DISABLE_OER_SUPPORT -w
PUBLIC -DNR_RRC_VERSION=${NR_RRC_RELEASE})
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