Encapsulate the asn1c call from cmake in a cmake function run_asn1c(). As a notable change to the previous manual add_custom_command() invocation, in suppresses the output of asn1c by default [1] and stores it in a log file. In case of asn1c4 error, the output will output on stdout. Use the new run_asn1c() in all occasions for code generation. [1] it is quite verbose, with many warnings that we cannot influence nor suppress, and lists all generated files which is verified by the build system automatically, anyway.
21 lines
759 B
CMake
21 lines
759 B
CMake
set(F1AP_VERSION 16 3 1)
|
|
make_version(F1AP_cc ${F1AP_VERSION})
|
|
string(REPLACE ";" "." F1AP_RELEASE "${F1AP_VERSION}")
|
|
|
|
if(F1AP_RELEASE VERSION_EQUAL "16.3.1")
|
|
include(ASN1/f1ap-16.3.1.cmake)
|
|
else()
|
|
message(FATAL_ERROR "unknown F1AP_RELEASE ${F1AP_RELEASE}")
|
|
endif()
|
|
|
|
run_asn1c(${CMAKE_CURRENT_SOURCE_DIR}/${F1AP_GRAMMAR}
|
|
"F1AP_"
|
|
OUTPUT ${f1ap_source} ${f1ap_headers}
|
|
OPTIONS -gen-APER -no-gen-BER -no-gen-JER -no-gen-OER -gen-UPER -fcompound-names -no-gen-example -findirect-choice -fno-include-deps
|
|
COMMENT "F1AP source files"
|
|
)
|
|
|
|
add_library(asn1_f1ap ${f1ap_source})
|
|
target_include_directories(asn1_f1ap PUBLIC "${CMAKE_CURRENT_BINARY_DIR}")
|
|
target_compile_options(asn1_f1ap PRIVATE -DASN_DISABLE_OER_SUPPORT -w)
|