mirror of
https://github.com/Kitware/CMake.git
synced 2026-02-27 11:18:35 -06:00
committed by
Brad King
parent
60a1ccbd6a
commit
36400e9dc1
@@ -14,3 +14,8 @@ its arguments to the tool. Some example tools are distcc and ccache.
|
|||||||
This property is initialized by the value of
|
This property is initialized by the value of
|
||||||
the :variable:`CMAKE_<LANG>_COMPILER_LAUNCHER` variable if it is set
|
the :variable:`CMAKE_<LANG>_COMPILER_LAUNCHER` variable if it is set
|
||||||
when a target is created.
|
when a target is created.
|
||||||
|
|
||||||
|
.. versionadded:: 3.25
|
||||||
|
|
||||||
|
The property value may use
|
||||||
|
:manual:`generator expressions <cmake-generator-expressions(7)>`.
|
||||||
|
|||||||
5
Help/release/dev/compiler-launcher-genexp.rst
Normal file
5
Help/release/dev/compiler-launcher-genexp.rst
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
compiler-launcher-genexp
|
||||||
|
------------------------
|
||||||
|
|
||||||
|
* The :prop_tgt:`<LANG>_COMPILER_LAUNCHER` target property now supports
|
||||||
|
:manual:`generator expressions <cmake-generator-expressions(7)>`.
|
||||||
@@ -1042,8 +1042,10 @@ void cmMakefileTargetGenerator::WriteObjectRuleFiles(
|
|||||||
lang == "OBJCXX")) {
|
lang == "OBJCXX")) {
|
||||||
std::string const clauncher_prop = lang + "_COMPILER_LAUNCHER";
|
std::string const clauncher_prop = lang + "_COMPILER_LAUNCHER";
|
||||||
cmValue clauncher = this->GeneratorTarget->GetProperty(clauncher_prop);
|
cmValue clauncher = this->GeneratorTarget->GetProperty(clauncher_prop);
|
||||||
if (cmNonempty(clauncher)) {
|
std::string evaluatedClauncher = cmGeneratorExpression::Evaluate(
|
||||||
compilerLauncher = *clauncher;
|
*clauncher, this->LocalGenerator, config);
|
||||||
|
if (!evaluatedClauncher.empty()) {
|
||||||
|
compilerLauncher = evaluatedClauncher;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -912,8 +912,10 @@ void cmNinjaTargetGenerator::WriteCompileRule(const std::string& lang,
|
|||||||
lang == "OBJCXX")) {
|
lang == "OBJCXX")) {
|
||||||
std::string const clauncher_prop = cmStrCat(lang, "_COMPILER_LAUNCHER");
|
std::string const clauncher_prop = cmStrCat(lang, "_COMPILER_LAUNCHER");
|
||||||
cmValue clauncher = this->GeneratorTarget->GetProperty(clauncher_prop);
|
cmValue clauncher = this->GeneratorTarget->GetProperty(clauncher_prop);
|
||||||
if (cmNonempty(clauncher)) {
|
std::string evaluatedClauncher = cmGeneratorExpression::Evaluate(
|
||||||
compilerLauncher = *clauncher;
|
*clauncher, this->LocalGenerator, config);
|
||||||
|
if (!evaluatedClauncher.empty()) {
|
||||||
|
compilerLauncher = evaluatedClauncher;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -17,7 +17,8 @@ endfunction()
|
|||||||
|
|
||||||
function(run_compiler_launcher_env lang)
|
function(run_compiler_launcher_env lang)
|
||||||
string(REGEX REPLACE "-.*" "" core_lang "${lang}")
|
string(REGEX REPLACE "-.*" "" core_lang "${lang}")
|
||||||
set(ENV{CMAKE_${core_lang}_COMPILER_LAUNCHER} "${CMAKE_COMMAND};-E;env;USED_LAUNCHER=1")
|
# Use the noop genexp $<PATH:...> genexp to validate genexp support.
|
||||||
|
set(ENV{CMAKE_${core_lang}_COMPILER_LAUNCHER} "$<PATH:CMAKE_PATH,${CMAKE_COMMAND}>;-E;env;USED_LAUNCHER=1")
|
||||||
run_compiler_launcher(${lang})
|
run_compiler_launcher(${lang})
|
||||||
unset(ENV{CMAKE_${core_lang}_COMPILER_LAUNCHER})
|
unset(ENV{CMAKE_${core_lang}_COMPILER_LAUNCHER})
|
||||||
endfunction()
|
endfunction()
|
||||||
|
|||||||
Reference in New Issue
Block a user