CMake now takes the option ASN1C_EXEC to select an asn1c to use for compilation. For instance, run with cmake .. -GNinja -DASN1C_EXEC=/opt/asn1c/bin/asn1c or ./build_oai --cmake-opt -DASN1C_EXEC=/opt/asn1c/bin/asn1c to select the alternative asn1c. For instance, this is important for the CI to allow to build multiple versions of OAI in parallel that might use different commits of OAI. Further, this patch introduces functionality to check for the support of asn1c options that we require, and alerts the user if they are missing, alongside a message of how to resolve the problem.
22 lines
942 B
CMake
22 lines
942 B
CMake
set(X2AP_VERSION 15 6 0)
|
|
make_version(X2AP_cc ${X2AP_VERSION})
|
|
#add_definitions(-DX2AP_VERSION=${X2AP_cc})
|
|
string(REPLACE ";" "." X2AP_RELEASE "${X2AP_VERSION}")
|
|
|
|
if(X2AP_RELEASE VERSION_EQUAL "15.6.0")
|
|
include(ASN1/R15/x2ap-15.6.0.cmake)
|
|
else()
|
|
message(FATAL_ERROR "unknown X2AP_RELEASE ${X2AP_RELEASE}")
|
|
endif()
|
|
|
|
add_custom_command(OUTPUT ${x2ap_source} ${x2ap_headers}
|
|
COMMAND ASN1C_PREFIX=X2AP_ ${ASN1C_EXEC} -pdu=all -gen-APER -no-gen-BER -no-gen-JER -no-gen-OER -gen-UPER -fcompound-names -no-gen-example -fno-include-deps -D ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/${X2AP_GRAMMAR}
|
|
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${X2AP_GRAMMAR}
|
|
COMMENT "Generating X2AP source files from ${CMAKE_CURRENT_SOURCE_DIR}/${X2AP_GRAMMAR}"
|
|
)
|
|
|
|
add_library(asn1_x2ap ${x2ap_source})
|
|
target_include_directories(asn1_x2ap PUBLIC "${CMAKE_CURRENT_BINARY_DIR}")
|
|
target_compile_options(asn1_x2ap PRIVATE -DASN_DISABLE_OER_SUPPORT -w)
|
|
|