Merge remote-tracking branch 'origin/asn1c-default-no-output' into integration_2025_w15 (!3368)

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.
This commit is contained in:
Robert Schmidt
2025-04-11 16:29:27 +02:00
13 changed files with 76 additions and 49 deletions
+5 -4
View File
@@ -9,10 +9,11 @@ include(ASN1/37355-g60.cmake)
# message(FATAL_ERROR "unknown LPP_RELEASE ${LPP_RELEASE}")
#endif()
add_custom_command(OUTPUT ${lpp_source} ${lpp_headers}
COMMAND ASN1C_PREFIX=LPP_ ${ASN1C_EXEC} -gen-UPER -no-gen-BER -no-gen-JER -no-gen-OER -gen-APER -fcompound-names -no-gen-example -findirect-choice -fno-include-deps -D ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/${LPP_GRAMMAR}
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${LPP_GRAMMAR}
COMMENT "Generating LPP source files from ${CMAKE_CURRENT_SOURCE_DIR}/${LPP_GRAMMAR}"
run_asn1c(${CMAKE_CURRENT_SOURCE_DIR}/${LPP_GRAMMAR}
"LPP_"
OUTPUT ${lpp_source} ${lpp_headers}
OPTIONS -gen-UPER -no-gen-BER -no-gen-JER -no-gen-OER -gen-APER -fcompound-names -no-gen-example -findirect-choice -fno-include-deps
COMMENT "LPP source files"
)
add_library(asn1_lpp ${lpp_source})
+5 -4
View File
@@ -16,10 +16,11 @@ else()
message(FATAL_ERROR "unknown M3AP_RELEASE ${M3AP_RELEASE}")
endif()
add_custom_command(OUTPUT ${m3ap_source} ${m3ap_headers}
COMMAND ASN1C_PREFIX=M3AP_ ${ASN1C_EXEC} -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}/${M3AP_GRAMMAR}
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${M3AP_GRAMMAR}
COMMENT "Generating M3AP source files from ${CMAKE_CURRENT_SOURCE_DIR}/${M3AP_GRAMMAR}"
run_asn1c(${CMAKE_CURRENT_SOURCE_DIR}/${M3AP_GRAMMAR}
"M3AP_"
OUTPUT ${m3ap_source} ${m3ap_headers}
OPTIONS -gen-APER -no-gen-BER -no-gen-JER -no-gen-OER -gen-UPER -fcompound-names -no-gen-example -fno-include-deps
COMMENT "M3AP source files"
)
add_library(asn1_m3ap ${m3ap_source})
+5 -4
View File
@@ -9,10 +9,11 @@ else()
message(FATAL_ERROR "unknown NGAP_RELEASE ${NGAP_RELEASE}")
endif()
add_custom_command(OUTPUT ${ngap_source} ${ngap_headers}
COMMAND ASN1C_PREFIX=NGAP_ ${ASN1C_EXEC} -pdu=all -fcompound-names -gen-APER -no-gen-BER -no-gen-JER -no-gen-OER -gen-UPER -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}"
run_asn1c(${CMAKE_CURRENT_SOURCE_DIR}/${NGAP_GRAMMAR}
"NGAP_"
OUTPUT ${ngap_source} ${ngap_headers}
OPTIONS -pdu=all -fcompound-names -gen-APER -no-gen-BER -no-gen-JER -no-gen-OER -gen-UPER -no-gen-example -fno-include-deps -findirect-choice
COMMENT "NGAP source files"
)
add_library(asn1_ngap ${ngap_source})
+5 -4
View File
@@ -9,10 +9,11 @@ include(ASN1/38455.cmake)
# message(FATAL_ERROR "unknown NRPPA_RELEASE ${NRPPA_RELEASE}")
#endif()
add_custom_command(OUTPUT ${nrppa_source} ${nrppa_headers}
COMMAND ASN1C_PREFIX=NRPPA_ ${ASN1C_EXEC} -gen-APER -gen-UPER -no-gen-OER -fcompound-names -no-gen-example -findirect-choice -fno-include-deps -D ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/${NRPPA_GRAMMAR}
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${NRPPA_GRAMMAR}
COMMENT "Generating NRPPA source files from ${CMAKE_CURRENT_SOURCE_DIR}/${NRPPA_GRAMMAR}"
run_asn1c(${CMAKE_CURRENT_SOURCE_DIR}/${NRPPA_GRAMMAR}
"NRPPA_"
OUTPUT ${nrppa_source} ${nrppa_headers}
OPTIONS -gen-APER -gen-UPER -no-gen-OER -fcompound-names -no-gen-example -findirect-choice -fno-include-deps
COMMENT "NRPPA source files"
)
add_library(asn1_nrppa ${nrppa_source})
+5 -4
View File
@@ -9,10 +9,11 @@ else()
message(FATAL_ERROR "unknown S1AP_RELEASE ${S1AP_RELEASE}")
endif()
add_custom_command(OUTPUT ${s1ap_source} ${s1ap_headers}
COMMAND ASN1C_PREFIX=S1AP_ ${ASN1C_EXEC} -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}/${S1AP_GRAMMAR}
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${S1AP_GRAMMAR}
COMMENT "Generating S1AP source files from ${CMAKE_CURRENT_SOURCE_DIR}/${S1AP_GRAMMAR}"
run_asn1c(${CMAKE_CURRENT_SOURCE_DIR}/${S1AP_GRAMMAR}
"S1AP_"
OUTPUT ${s1ap_source} ${s1ap_headers}
OPTIONS -gen-APER -no-gen-BER -no-gen-JER -no-gen-OER -gen-UPER -fcompound-names -no-gen-example -fno-include-deps
COMMENT "S1AP source files"
)
add_library(asn1_s1ap ${s1ap_source})