Generate and build NGAP ASN.1 during build time

This commit is contained in:
Robert Schmidt
2022-12-02 15:42:50 +01:00
parent 2a93484f2b
commit 2e6a1c36a4
6 changed files with 1295 additions and 33 deletions
+1
View File
@@ -1 +1,2 @@
add_subdirectory(S1AP)
add_subdirectory(NGAP)
+1
View File
@@ -0,0 +1 @@
add_subdirectory(MESSAGES)
File diff suppressed because it is too large Load Diff
+20
View File
@@ -0,0 +1,20 @@
set(NGAP_VERSION 15 8 0)
make_version(NGAP_cc ${NGAP_VERSION})
#add_definitions(-DNGAP_VERSION=${NGAP_cc})
string(REPLACE ";" "." NGAP_RELEASE "${NGAP_VERSION}")
if(NGAP_RELEASE VERSION_EQUAL "15.8.0")
include(ASN1/ngap-15.8.0.cmake)
else()
message(FATAL_ERROR "unknown NGAP_RELEASE ${NGAP_RELEASE}")
endif()
add_custom_command(OUTPUT ${ngap_source} ${ngap_headers}
COMMAND ASN1C_PREFIX=NGAP_ asn1c -pdu=all -fcompound-names -gen-PER -no-gen-OER -no-gen-example -fno-include-deps -findirect-choice -D ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/${NGAP_GRAMMAR}
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${NGAP_GRAMMAR}
COMMENT "Generating NGAP source files from ${CMAKE_CURRENT_SOURCE_DIR}/${NGAP_GRAMMAR}"
)
add_library(asn1_ngap ${ngap_source})
target_include_directories(asn1_ngap PUBLIC "${CMAKE_CURRENT_BINARY_DIR}")
target_compile_options(asn1_ngap PRIVATE -DASN_DISABLE_OER_SUPPORT -w)