summaryrefslogtreecommitdiffstats
path: root/Source/cmNinjaTargetGenerator.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2015-10-20 17:52:12 (GMT)
committerBrad King <brad.king@kitware.com>2015-10-20 18:14:20 (GMT)
commit123de1914c7e7d53d1e295c73994b2780041b8fc (patch)
treed5f7dba847c7baaf99c9347b0c6024762fc474ff /Source/cmNinjaTargetGenerator.cxx
parent9afbb733ec2a55424e6c25c6afa7fdd14219d6b1 (diff)
downloadCMake-123de1914c7e7d53d1e295c73994b2780041b8fc.zip
CMake-123de1914c7e7d53d1e295c73994b2780041b8fc.tar.gz
CMake-123de1914c7e7d53d1e295c73994b2780041b8fc.tar.bz2
Ninja: Refactor selection of 'deps = ' value for MS-compatible toolchains
Set variables in the platform information modules to tell the Ninja generator what deps type to use instead of hard-coding conditions in the generator itself.
Diffstat (limited to 'Source/cmNinjaTargetGenerator.cxx')
-rw-r--r--Source/cmNinjaTargetGenerator.cxx16
1 files changed, 4 insertions, 12 deletions
diff --git a/Source/cmNinjaTargetGenerator.cxx b/Source/cmNinjaTargetGenerator.cxx
index cb1122c..b018005 100644
--- a/Source/cmNinjaTargetGenerator.cxx
+++ b/Source/cmNinjaTargetGenerator.cxx
@@ -148,17 +148,9 @@ void cmNinjaTargetGenerator::AddIncludeFlags(std::string& languageFlags,
bool cmNinjaTargetGenerator::NeedDepTypeMSVC(const std::string& lang) const
{
- if (lang == "C" || lang == "CXX")
- {
- cmMakefile* mf = this->GetMakefile();
- return (
- strcmp(mf->GetSafeDefinition("CMAKE_C_COMPILER_ID"), "MSVC") == 0 ||
- strcmp(mf->GetSafeDefinition("CMAKE_CXX_COMPILER_ID"), "MSVC") == 0 ||
- strcmp(mf->GetSafeDefinition("CMAKE_C_SIMULATE_ID"), "MSVC") == 0 ||
- strcmp(mf->GetSafeDefinition("CMAKE_CXX_SIMULATE_ID"), "MSVC") == 0
- );
- }
- return false;
+ return strcmp(
+ this->GetMakefile()->GetSafeDefinition("CMAKE_NINJA_DEPTYPE_" + lang),
+ "msvc") == 0;
}
// TODO: Refactor with
@@ -359,7 +351,7 @@ cmNinjaTargetGenerator
depfile = "";
flags += " /showIncludes";
}
- else if (lang == "RC" && this->NeedDepTypeMSVC("C"))
+ else if (mf->IsOn("CMAKE_NINJA_CMCLDEPS_"+lang))
{
// For the MS resource compiler we need cmcldeps, but skip dependencies
// for source-file try_compile cases because they are always fresh.