|
@@ -47,6 +47,9 @@ FALSE=no
|
|
|
MODULE_PREFIX=
|
|
|
MODULE_SUFFIX=
|
|
|
|
|
|
+# do not keep it undefined, since we directly subsitute it in LLVM_COMPILE_CXX etc.
|
|
|
+WINDOWS=no
|
|
|
+
|
|
|
# tag:src-processing tag:internal
|
|
|
### @usage: _SRC(Ext Src Flags) # internal
|
|
|
###
|
|
@@ -187,13 +190,6 @@ CLANG_CSA_ROOT=${CLANG_CSA16_RESOURCE_GLOBAL}
|
|
|
CLANG_CSA_BIN=${CLANG_CSA16_RESOURCE_GLOBAL}/bin/clang
|
|
|
when ($CLANG_SA_ENABLE == "yes" && $_CLANG_SA_CONFIG && $CLANG_CSA_ROOT) {
|
|
|
PEERDIR+=build/platform/clang/clang-static-analyzer
|
|
|
- CLANG_STATIC_ANALYZER_OPTIONS=$YMAKE_PYTHON3 ${input:"build/scripts/clang_static_analyzer.py"} \
|
|
|
- "--testing-src" ${input:SRC} \
|
|
|
- "--clang-bin" $CLANG_CSA_BIN \
|
|
|
- "--source-root" $(SOURCE_ROOT) \
|
|
|
- "--config-file" ${input:_CLANG_SA_CONFIG} \
|
|
|
- "--plugins-begin" "dummy_param" $_CLANG_SA_UNWRAP_PLUGINS($CLANG_SA_PLUGINS) "--plugins-end" \
|
|
|
- $GCC_COMPILE_FLAGS $CXXFLAGS $SRCFLAGS
|
|
|
CLANG_STATIC_ANALYZER_OPTIONS_NEW=$YMAKE_PYTHON3 ${input:"build/scripts/clang_static_analyzer.py"} \
|
|
|
"--testing-src" ${input:SRC} \
|
|
|
"--clang-bin" $CLANG_CSA_BIN \
|
|
@@ -201,12 +197,9 @@ when ($CLANG_SA_ENABLE == "yes" && $_CLANG_SA_CONFIG && $CLANG_CSA_ROOT) {
|
|
|
"--config-file" ${input:_CLANG_SA_CONFIG} \
|
|
|
"--plugins-begin" "dummy_param" $CLANG_SA_PLUGINS "--plugins-end" \
|
|
|
$GCC_COMPILE_FLAGS $CXXFLAGS $SRCFLAGS
|
|
|
- CLANG_STATIC_ANALYZER_OPTIONS_NEW_FORCED=$_FORCE_CPP_FLAGS
|
|
|
}
|
|
|
otherwise {
|
|
|
- CLANG_STATIC_ANALYZER_OPTIONS=
|
|
|
CLANG_STATIC_ANALYZER_OPTIONS_NEW=
|
|
|
- CLANG_STATIC_ANALYZER_OPTIONS_NEW_FORCED=
|
|
|
}
|
|
|
|
|
|
FAIL_MODULE_CMD=$YMAKE_PYTHON3 ${input:"build/scripts/fail_module_cmd.py"} $TARGET ${hide;kv:"p ER"} ${hide;kv:"pc red"}
|
|
@@ -3207,7 +3200,7 @@ _SRC_CPP_TOOLCHAIN_INFO_PEER=
|
|
|
|
|
|
# tag:src-processing
|
|
|
macro _SRC("cpp", SRC, SRCFLAGS...) {
|
|
|
- .CMD=$_SRC_CPP_CMD_NEW
|
|
|
+ .CMD=$_SRC_cpp_new($SRC $SRCFLAGS)
|
|
|
.PEERDIR=$_SRC_CPP_TOOLCHAIN_INFO_PEER
|
|
|
.SEM=target_sources PRIVATE ${input:SRC} ${hide;output;suf=${OBJ_SUF}.o:SRC} && target_options-privates-ITEM && target_options-privates-option target_sources && target_options-privates-args ${input:SRC} ${hide;output;suf=${OBJ_SUF}.o:SRC} $_ADD_EXTRA_FLAGS($SRCFLAGS)
|
|
|
.STRUCT_CMD=yes
|
|
@@ -3215,7 +3208,7 @@ macro _SRC("cpp", SRC, SRCFLAGS...) {
|
|
|
|
|
|
# tag:src-processing
|
|
|
macro _SRC("cxx", SRC, SRCFLAGS...) {
|
|
|
- .CMD=$_SRC_CPP_CMD_NEW
|
|
|
+ .CMD=$_SRC_cpp_new($SRC $SRCFLAGS)
|
|
|
.PEERDIR=$_SRC_CPP_TOOLCHAIN_INFO_PEER
|
|
|
.SEM=target_sources PRIVATE ${input:SRC} ${hide;output;suf=${OBJ_SUF}.o:SRC} && target_options-privates-ITEM && target_options-privates-option target_sources && target_options-privates-args ${input:SRC} ${hide;output;suf=${OBJ_SUF}.o:SRC} $_ADD_EXTRA_FLAGS($SRCFLAGS)
|
|
|
.STRUCT_CMD=yes
|
|
@@ -3223,7 +3216,7 @@ macro _SRC("cxx", SRC, SRCFLAGS...) {
|
|
|
|
|
|
# tag:src-processing
|
|
|
macro _SRC("cc", SRC, SRCFLAGS...) {
|
|
|
- .CMD=$_SRC_CPP_CMD_NEW
|
|
|
+ .CMD=$_SRC_cpp_new($SRC $SRCFLAGS)
|
|
|
.PEERDIR=$_SRC_CPP_TOOLCHAIN_INFO_PEER
|
|
|
.SEM=target_sources PRIVATE ${input:SRC} ${hide;output;suf=${OBJ_SUF}.o:SRC} && target_options-privates-ITEM && target_options-privates-option target_sources && target_options-privates-args ${input:SRC} ${hide;output;suf=${OBJ_SUF}.o:SRC} $_ADD_EXTRA_FLAGS($SRCFLAGS)
|
|
|
.STRUCT_CMD=yes
|
|
@@ -3231,7 +3224,7 @@ macro _SRC("cc", SRC, SRCFLAGS...) {
|
|
|
|
|
|
# tag:src-processing
|
|
|
macro _SRC("auxcpp", SRC, SRCFLAGS...) {
|
|
|
- .CMD=$_SRC_CPP_CMD_NEW_FORCED
|
|
|
+ .CMD=$_SRC_cpp_new($SRC $_FORCE_CPP_FLAGS $SRCFLAGS)
|
|
|
.PEERDIR=$_SRC_CPP_TOOLCHAIN_INFO_PEER
|
|
|
.SEM=target_sources PRIVATE ${input:SRC} ${hide;output;suf=${OBJ_SUF}.o:SRC} && target_options-privates-ITEM && target_options-privates-option target_sources && target_options-privates-args ${input:SRC} ${hide;output;suf=${OBJ_SUF}.o:SRC} $_ADD_EXTRA_FLAGS($_FORCE_CPP_FLAGS $SRCFLAGS)
|
|
|
.STRUCT_CMD=yes
|
|
@@ -3239,7 +3232,7 @@ macro _SRC("auxcpp", SRC, SRCFLAGS...) {
|
|
|
|
|
|
# tag:src-processing
|
|
|
macro _SRC("C", SRC, SRCFLAGS...) {
|
|
|
- .CMD=$_SRC_CPP_CMD_NEW
|
|
|
+ .CMD=$_SRC_cpp_new($SRC $SRCFLAGS)
|
|
|
.PEERDIR=$_SRC_CPP_TOOLCHAIN_INFO_PEER
|
|
|
.SEM=target_sources PRIVATE ${input:SRC} ${hide;output;suf=${OBJ_SUF}.o:SRC} && target_options-privates-ITEM && target_options-privates-option target_sources && target_options-privates-args ${input:SRC} ${hide;output;suf=${OBJ_SUF}.o:SRC} $_ADD_EXTRA_FLAGS($SRCFLAGS)
|
|
|
.STRUCT_CMD=yes
|
|
@@ -3247,7 +3240,7 @@ macro _SRC("C", SRC, SRCFLAGS...) {
|
|
|
|
|
|
# tag:src-processing
|
|
|
macro _SRC("c", SRC, SRCFLAGS...) {
|
|
|
- .CMD=$_SRC_C_CMD_NEW
|
|
|
+ .CMD=$_SRC_c_new($SRC $SRCFLAGS)
|
|
|
.PEERDIR=$_SRC_CPP_TOOLCHAIN_INFO_PEER
|
|
|
.SEM=target_sources PRIVATE ${input:SRC} ${hide;output;suf=${OBJ_SUF}.o:SRC} && target_options-privates-ITEM && target_options-privates-option target_sources && target_options-privates-args ${input:SRC} ${hide;output;suf=${OBJ_SUF}.o:SRC} $_ADD_EXTRA_FLAGS($SRCFLAGS $USER_CONLYFLAGS $USER_CONLYFLAGS_GLOBAL)
|
|
|
.STRUCT_CMD=yes
|
|
@@ -3373,12 +3366,11 @@ macro _SRC_PYSRC(SRC, SRCFLAGS...) {
|
|
|
|
|
|
# tag:src-processing
|
|
|
macro _SRC_c_nodeps(SRC, OUTFILE, INC...) {
|
|
|
+ # this macro is used by link commands; TODO switch to the new engine after those
|
|
|
.CMD=$_SRC_C_NODEPS_CMD
|
|
|
}
|
|
|
|
|
|
-# Custom flags for generated cpp-files. To support another generator:
|
|
|
-# - insert additional file extension before .cpp into generated cpp-file name
|
|
|
-# - update _LANG_CFLAGS_FILTER variable. Don't forget to add ' SKIP ' after flag list
|
|
|
+# Custom flags for generated cpp-files
|
|
|
#
|
|
|
# ragel5 and ragel6 generated terrible code which makes use of goto's in switch statements.
|
|
|
# This triggers -Werror-implicit-fallthrough due to `unannotated fall-through between switch labels`.
|
|
@@ -3390,44 +3382,23 @@ macro _SRC_c_nodeps(SRC, OUTFILE, INC...) {
|
|
|
# generated sources
|
|
|
## tag:src-processing
|
|
|
when ($CLANG == "yes") {
|
|
|
- _LANG_CFLAGS_FILTER=\
|
|
|
- ${pre=-Wno-implicit-fallthrough -fno-profile-instr-generate -fno-coverage-mapping SKIP ;ext=.rl5:SRC} \
|
|
|
- ${pre=-Wno-implicit-fallthrough -fno-profile-instr-generate -fno-coverage-mapping SKIP ;ext=.rl6:SRC} \
|
|
|
- ${pre=-Wno-implicit-fallthrough -fno-profile-instr-generate -fno-coverage-mapping SKIP ;ext=.pyx:SRC}
|
|
|
_LANG_CFLAGS_RL=-Wno-implicit-fallthrough -fno-profile-instr-generate -fno-coverage-mapping
|
|
|
_LANG_CFLAGS_SWG=-Wno-deprecated-declarations -fno-profile-instr-generate -fno-coverage-mapping
|
|
|
_LANG_CFLAGS_LEX=-Wno-unused-variable -fno-profile-instr-generate -fno-coverage-mapping
|
|
|
_LANG_CFLAGS_BISON=-Wno-unused-but-set-variable -Wno-deprecated-copy -fno-profile-instr-generate -fno-coverage-mapping
|
|
|
}
|
|
|
otherwise {
|
|
|
- _LANG_CFLAGS_FILTER=\
|
|
|
- ${pre=-Wno-implicit-fallthrough SKIP ;ext=.rl5:SRC} \
|
|
|
- ${pre=-Wno-implicit-fallthrough SKIP ;ext=.rl6:SRC} \
|
|
|
- ${pre=-Wno-implicit-fallthrough SKIP ;ext=.pyx:SRC}
|
|
|
_LANG_CFLAGS_RL=-Wno-implicit-fallthrough
|
|
|
_LANG_CFLAGS_SWG=-Wno-deprecated-declarations
|
|
|
_LANG_CFLAGS_LEX=-Wno-unused-variable
|
|
|
_LANG_CFLAGS_BISON=-Wno-unused-but-set-variable -Wno-deprecated-copy
|
|
|
}
|
|
|
|
|
|
-# tag:src-processing
|
|
|
-# Magic macro for removing file name from result (file name is passed as unused SKIP parameter)
|
|
|
-macro _FILTER_EXTS(SKIP="", FLAGS...) {
|
|
|
- .CMD=$FLAGS
|
|
|
-}
|
|
|
-
|
|
|
-# tag:src-processing
|
|
|
-macro _LANG_CFLAGS(SRC) {
|
|
|
- .CMD=$_FILTER_EXTS($_LANG_CFLAGS_FILTER)
|
|
|
-}
|
|
|
-
|
|
|
# tag:src-processing
|
|
|
# ymake bug workaround: variables followed a macros call in .CMD are not substituted and are placed in result as is
|
|
|
# Pack macro call into a variable and use it in _SRC_CPP_CMD instead of macro call
|
|
|
-_LANG_CFLAGS_VALUE=
|
|
|
_LANG_CFLAGS_VALUE_NEW=
|
|
|
when ($CLANG == "yes" || $CLANG_CL == "yes" || $GCC == "yes") {
|
|
|
- _LANG_CFLAGS_VALUE=$_LANG_CFLAGS(${noext:SRC})
|
|
|
_LANG_CFLAGS_VALUE_NEW=\
|
|
|
${pre=$_LANG_CFLAGS_BISON;clear;ext=.y;noext;input:SRC} \
|
|
|
${pre=$_LANG_CFLAGS_BISON;clear;ext=.ypp;noext;input:SRC} \
|
|
@@ -3441,26 +3412,24 @@ when ($CLANG == "yes" || $CLANG_CL == "yes" || $GCC == "yes") {
|
|
|
# Allows to add single compilation unit name to the node's 'kv' section.
|
|
|
# This is used by the coverage machinery to instrument only the necessary sources
|
|
|
# when --coverage-prefix-filter <rootrelpath> is specified. For more info see DEVTOOLSSUPPORT-16891
|
|
|
-SCU_NAME_KV=
|
|
|
SCU_NAME_KV_NEW=
|
|
|
SCU_NAME_KV_NEW_BODY=scu_name ${input:SRC}
|
|
|
when ($CLANG_COVERAGE && $CLANG_COVERAGE != "no" && $USE_SCU_VALUE == "yes") {
|
|
|
- SCU_NAME_KV=${hide;kv:"scu_name $KV_VAL"}
|
|
|
SCU_NAME_KV_NEW=${hide;kv:SCU_NAME_KV_NEW_BODY}
|
|
|
}
|
|
|
|
|
|
-macro _ADD_SCU_NAME(KV_VAL) {
|
|
|
- .CMD=$SCU_NAME_KV
|
|
|
+macro _ADD_SCU_NAME_NEW(KV_VAL) {
|
|
|
+ .CMD=$SCU_NAME_KV_NEW
|
|
|
}
|
|
|
|
|
|
# tag:src-processing
|
|
|
-macro _SRC_cpp(SRC, COMPILE_OUT_SUFFIX="", SRCFLAGS...) {
|
|
|
- .CMD=$_SRC_CPP_CMD $_ADD_SCU_NAME(${input:SRC})
|
|
|
+macro _SRC_cpp_new(SRC, COMPILE_OUT_SUFFIX="", SRCFLAGS...) {
|
|
|
+ .CMD=$_SRC_CPP_CMD_NEW && $_ADD_SCU_NAME_NEW(${input:SRC})
|
|
|
}
|
|
|
|
|
|
# tag:src-processing
|
|
|
-macro _SRC_c(SRC, COMPILE_OUT_SUFFIX="", SRCFLAGS...) {
|
|
|
- .CMD=$_SRC_C_CMD $_ADD_SCU_NAME(${input:SRC})
|
|
|
+macro _SRC_c_new(SRC, COMPILE_OUT_SUFFIX="", SRCFLAGS...) {
|
|
|
+ .CMD=$_SRC_C_CMD_NEW $_ADD_SCU_NAME_NEW(${input:SRC})
|
|
|
}
|
|
|
|
|
|
# tag:src-processing
|
|
@@ -3607,13 +3576,15 @@ macro SRCS(FILES...) {
|
|
|
|
|
|
# tag:c-specific
|
|
|
macro _SRC_C_CUSTOM_FLAGS(SRC, COMPILE_OUT_SUFFIX, CUSTOM_FLAGS...) {
|
|
|
- .CMD=$_SRC_c($SRC COMPILE_OUT_SUFFIX ${COMPILE_OUT_SUFFIX} ${CUSTOM_FLAGS})
|
|
|
+ .CMD=$_SRC_c_new($SRC COMPILE_OUT_SUFFIX ${COMPILE_OUT_SUFFIX} ${CUSTOM_FLAGS})
|
|
|
.SEM=target_sources_custom $COMPILE_OUT_SUFFIX SRCS ${input:SRC} ${hide;output;suf=${COMPILE_OUT_SUFFIX}.o:SRC} CUSTOM_FLAGS $CUSTOM_FLAGS $USER_CONLYFLAGS $USER_CONLYFLAGS_GLOBAL && target_macroses-ITEM && target_macroses-macro target_sources_custom && target_macroses-args $COMPILE_OUT_SUFFIX SRCS ${input:SRC} ${hide;output;suf=${COMPILE_OUT_SUFFIX}.o:SRC} CUSTOM_FLAGS $CUSTOM_FLAGS $USER_CONLYFLAGS $USER_CONLYFLAGS_GLOBAL
|
|
|
+ .STRUCT_CMD=yes
|
|
|
}
|
|
|
|
|
|
macro _SRC_CPP_CUSTOM_FLAGS(SRC, COMPILE_OUT_SUFFIX, CUSTOM_FLAGS...) {
|
|
|
- .CMD=$_SRC_cpp($SRC COMPILE_OUT_SUFFIX ${COMPILE_OUT_SUFFIX} ${CUSTOM_FLAGS})
|
|
|
+ .CMD=$_SRC_cpp_new($SRC COMPILE_OUT_SUFFIX ${COMPILE_OUT_SUFFIX} ${CUSTOM_FLAGS})
|
|
|
.SEM=target_sources_custom $COMPILE_OUT_SUFFIX SRCS ${input:SRC} ${hide;output;suf=${COMPILE_OUT_SUFFIX}.o:SRC} CUSTOM_FLAGS $CUSTOM_FLAGS && target_macroses-ITEM && target_macroses-macro target_sources_custom && target_macroses-args $COMPILE_OUT_SUFFIX SRCS ${input:SRC} ${hide;output;suf=${COMPILE_OUT_SUFFIX}.o:SRC} CUSTOM_FLAGS $CUSTOM_FLAGS
|
|
|
+ .STRUCT_CMD=yes
|
|
|
}
|
|
|
|
|
|
|
|
@@ -4776,6 +4747,7 @@ macro CLANG_EMIT_AST_CXX(Input, Output, Opts...) {
|
|
|
macro LLVM_COMPILE_CXX(Input, Output, Opts...) {
|
|
|
.CMD=$YMAKE_PYTHON ${input:"build/scripts/clang_wrapper.py"} $WINDOWS ${CLANG_BC_ROOT}/bin/clang++ ${pre=-I:_C__INCLUDE} $BC_CXXFLAGS $C_FLAGS_PLATFORM -Wno-unknown-warning-option $LLVM_OPTS ${NO_LTO_CFLAGS} -emit-llvm -c ${input:Input} -o ${noauto;output:Output} $Opts ${hide;kv:"p BC"} ${hide;kv:"pc light-green"}
|
|
|
.SEM=llvm_compile_cxx ${input:Input} ${noauto;output:Output} ${"${CLANGPLUSPLUS}"} -Wno-unknown-warning-option $LLVM_OPTS ${NO_LTO_CFLAGS} -emit-llvm ${Opts} && target_macroses-ITEM && target_macroses-macro llvm_compile_cxx && target_macroses-args ${input:Input} ${noauto;output:Output} ${"${CLANGPLUSPLUS}"} -Wno-unknown-warning-option $LLVM_OPTS ${NO_LTO_CFLAGS} -emit-llvm ${Opts}
|
|
|
+ .STRUCT_CMD=yes
|
|
|
when ($CLANG_BC_ROOT == "") {
|
|
|
_OK = no
|
|
|
}
|
|
@@ -4790,6 +4762,7 @@ macro LLVM_COMPILE_CXX(Input, Output, Opts...) {
|
|
|
macro LLVM_COMPILE_C(Input, Output, Opts...) {
|
|
|
.CMD=$YMAKE_PYTHON ${input:"build/scripts/clang_wrapper.py"} $WINDOWS ${CLANG_BC_ROOT}/bin/clang ${pre=-I:_C__INCLUDE} $BC_CFLAGS $C_FLAGS_PLATFORM $LLVM_OPTS ${NO_LTO_CFLAGS} -emit-llvm -c ${input:Input} -o ${noauto;output:Output} $Opts ${hide;kv:"p BC"} ${hide;kv:"pc light-green"}
|
|
|
.SEM=llvm_compile_c ${input:Input} ${noauto;output:Output} ${"${CLANGC}"} -Wno-unknown-warning-option $LLVM_OPTS ${NO_LTO_CFLAGS} -emit-llvm ${Opts} && target_macroses-ITEM && target_macroses-macro llvm_compile_c && target_macroses-args ${input:Input} ${noauto;output:Output} ${"${CLANGC}"} -Wno-unknown-warning-option $LLVM_OPTS ${NO_LTO_CFLAGS} -emit-llvm ${Opts}
|
|
|
+ .STRUCT_CMD=yes
|
|
|
when ($CLANG_BC_ROOT == "") {
|
|
|
_OK = no
|
|
|
}
|