C++: Handle codeql_action_cpp_build_mode_none feature flag

This commit is contained in:
Calum Grant 2024-10-24 16:46:58 +01:00
parent 467d7e6d9e
commit 0d2a78f583
6 changed files with 37 additions and 20 deletions

15
lib/init-action.js generated
View file

@ -316,6 +316,21 @@ async function run() {
core.exportVariable(envVar, "false");
}
}
// Set CODEQL_EXTRACTOR_CPP_BUILD_MODE_NONE
if (config.languages.includes(languages_1.Language.cpp)) {
const bmn_var = "CODEQL_EXTRACTOR_CPP_BUILD_MODE_NONE";
if (process.env[bmn_var]) {
logger.info("CODEQL_EXTRACTOR_CPP_BUILD_MODE_NONE is already set");
}
else if (await features.getValue(feature_flags_1.Feature.CppBuildModeNone, codeql)) {
logger.info("Enabling C++ build-mode: none");
core.exportVariable(bmn_var, "true");
}
else {
logger.info("Disabling C++ build-mode: none");
core.exportVariable(bmn_var, "false");
}
}
// For CLI versions <2.15.1, build tracing caused errors in MacOS ARM machines with
// System Integrity Protection (SIP) disabled.
if (!(await (0, util_1.codeQlVersionAtLeast)(codeql, "2.15.1")) &&