diff options
author | Peter Kümmel <syntheticpp@gmx.net> | 2012-08-22 10:37:55 (GMT) |
---|---|---|
committer | Peter Kümmel <syntheticpp@gmx.net> | 2012-08-22 10:37:55 (GMT) |
commit | 4bb4787780e51d18b9744f52bfa635818dd34ca5 (patch) | |
tree | aee5a007867486c271601ce8939f55029ead9e20 /Source/cmNinjaTargetGenerator.cxx | |
parent | 59cbc28b92bf0cd91f760985edcde625a6fbcf6c (diff) | |
download | CMake-4bb4787780e51d18b9744f52bfa635818dd34ca5.zip CMake-4bb4787780e51d18b9744f52bfa635818dd34ca5.tar.gz CMake-4bb4787780e51d18b9744f52bfa635818dd34ca5.tar.bz2 |
Ninja:split out setting of msvc TARGET_PDB
Diffstat (limited to 'Source/cmNinjaTargetGenerator.cxx')
-rw-r--r-- | Source/cmNinjaTargetGenerator.cxx | 31 |
1 files changed, 18 insertions, 13 deletions
diff --git a/Source/cmNinjaTargetGenerator.cxx b/Source/cmNinjaTargetGenerator.cxx index 328ca2d..b89602e 100644 --- a/Source/cmNinjaTargetGenerator.cxx +++ b/Source/cmNinjaTargetGenerator.cxx @@ -311,6 +311,21 @@ std::string cmNinjaTargetGenerator::GetTargetPDB() const return targetFullPathPDB.c_str(); } +bool cmNinjaTargetGenerator::SetMsvcTargetPdbVariable(cmNinjaVars& vars) const +{ + cmMakefile* mf = this->GetMakefile(); + if (mf->GetDefinition("MSVC_C_ARCHITECTURE_ID") || + mf->GetDefinition("MSVC_CXX_ARCHITECTURE_ID")) + { + const std::string pdbPath = this->GetTargetPDB(); + vars["TARGET_PDB"] = this->GetLocalGenerator()->ConvertToOutputFormat( + ConvertToNinjaPath(pdbPath.c_str()).c_str(), + cmLocalGenerator::SHELL); + EnsureParentDirectoryExists(pdbPath); + return true; + } + return false; +} void cmNinjaTargetGenerator @@ -537,17 +552,7 @@ cmNinjaTargetGenerator vars["DEP_FILE"] = objectFileName + ".d";; EnsureParentDirectoryExists(objectFileName); - // TODO move to GetTargetPDB - cmMakefile* mf = this->GetMakefile(); - if (mf->GetDefinition("MSVC_C_ARCHITECTURE_ID") || - mf->GetDefinition("MSVC_CXX_ARCHITECTURE_ID")) - { - const std::string pdbPath = this->GetTargetPDB(); - vars["TARGET_PDB"] = this->GetLocalGenerator()->ConvertToOutputFormat( - ConvertToNinjaPath(pdbPath.c_str()).c_str(), - cmLocalGenerator::SHELL); - EnsureParentDirectoryExists(pdbPath); - } + this->SetMsvcTargetPdbVariable(vars); if(this->Makefile->IsOn("CMAKE_EXPORT_COMPILE_COMMANDS")) { @@ -643,14 +648,14 @@ cmNinjaTargetGenerator void cmNinjaTargetGenerator -::EnsureDirectoryExists(const std::string& dir) +::EnsureDirectoryExists(const std::string& dir) const { cmSystemTools::MakeDirectory(dir.c_str()); } void cmNinjaTargetGenerator -::EnsureParentDirectoryExists(const std::string& path) +::EnsureParentDirectoryExists(const std::string& path) const { EnsureDirectoryExists(cmSystemTools::GetParentDirectory(path.c_str())); } |