diff options
author | Vitaly Stakhovsky <vvs31415@gitlab.org> | 2020-05-29 04:00:00 (GMT) |
---|---|---|
committer | Vitaly Stakhovsky <vvs31415@gitlab.org> | 2020-05-29 17:12:22 (GMT) |
commit | 1e805f53f5520d8b13d306331fe1f0b34b5d9d7d (patch) | |
tree | 904b39e963db393fa5f982c39639361693d26b6e /Source/cmNinjaTargetGenerator.cxx | |
parent | 1336d11d9ceabf070b75816b91c7ae9459f0817c (diff) | |
download | CMake-1e805f53f5520d8b13d306331fe1f0b34b5d9d7d.zip CMake-1e805f53f5520d8b13d306331fe1f0b34b5d9d7d.tar.gz CMake-1e805f53f5520d8b13d306331fe1f0b34b5d9d7d.tar.bz2 |
GetDefinition: avoid duplicate calls
Diffstat (limited to 'Source/cmNinjaTargetGenerator.cxx')
-rw-r--r-- | Source/cmNinjaTargetGenerator.cxx | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Source/cmNinjaTargetGenerator.cxx b/Source/cmNinjaTargetGenerator.cxx index c77a85b..4390790 100644 --- a/Source/cmNinjaTargetGenerator.cxx +++ b/Source/cmNinjaTargetGenerator.cxx @@ -749,9 +749,9 @@ void cmNinjaTargetGenerator::WriteCompileRule(const std::string& lang, if (!mf->GetIsSourceFileTryCompile()) { rule.DepType = "gcc"; rule.DepFile = "$DEP_FILE"; - const std::string cl = mf->GetDefinition("CMAKE_C_COMPILER") - ? mf->GetSafeDefinition("CMAKE_C_COMPILER") - : mf->GetSafeDefinition("CMAKE_CXX_COMPILER"); + auto d = mf->GetDefinition("CMAKE_C_COMPILER"); + const std::string cl = + d ? d : mf->GetSafeDefinition("CMAKE_CXX_COMPILER"); cldeps = cmStrCat('"', cmSystemTools::GetCMClDepsCommand(), "\" ", lang, ' ', vars.Source, " $DEP_FILE $out \"", mf->GetSafeDefinition("CMAKE_CL_SHOWINCLUDES_PREFIX"), |