summaryrefslogtreecommitdiffstats
path: root/Source/cmNinjaNormalTargetGenerator.cxx
diff options
context:
space:
mode:
authorDavid Cole <david.cole@kitware.com>2012-08-24 18:24:35 (GMT)
committerCMake Topic Stage <kwrobot@kitware.com>2012-08-24 18:24:35 (GMT)
commited01420c2337bd641a62d6ae5e7d81eb81d41cac (patch)
treeceaba17b164d0d7dd13e6f81843d1c326247a264 /Source/cmNinjaNormalTargetGenerator.cxx
parent05784dadc59ee3c87ab6140d684ff4c602de9ec1 (diff)
parent709fa59562569b6c6a8244f5ba53b60ebf840a30 (diff)
downloadCMake-ed01420c2337bd641a62d6ae5e7d81eb81d41cac.zip
CMake-ed01420c2337bd641a62d6ae5e7d81eb81d41cac.tar.gz
CMake-ed01420c2337bd641a62d6ae5e7d81eb81d41cac.tar.bz2
Merge topic 'ninja-target-pdb-cleanup'
709fa59 Ninja: remove GetTargetPDB because it is used only once 4bb4787 Ninja:split out setting of msvc TARGET_PDB 59cbc28 Ninja: prepare msvc pdb cleanup
Diffstat (limited to 'Source/cmNinjaNormalTargetGenerator.cxx')
-rw-r--r--Source/cmNinjaNormalTargetGenerator.cxx35
1 files changed, 13 insertions, 22 deletions
diff --git a/Source/cmNinjaNormalTargetGenerator.cxx b/Source/cmNinjaNormalTargetGenerator.cxx
index a923d60..9dc860e 100644
--- a/Source/cmNinjaNormalTargetGenerator.cxx
+++ b/Source/cmNinjaNormalTargetGenerator.cxx
@@ -459,25 +459,16 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement()
}
}
- std::string path;
if (!this->TargetNameImport.empty()) {
- path = this->GetLocalGenerator()->ConvertToOutputFormat(
- targetOutputImplib.c_str(), cmLocalGenerator::SHELL);
- vars["TARGET_IMPLIB"] = path;
- EnsureParentDirectoryExists(path);
+ const std::string impLibPath = this->GetLocalGenerator()
+ ->ConvertToOutputFormat(targetOutputImplib.c_str(),
+ cmLocalGenerator::SHELL);
+ vars["TARGET_IMPLIB"] = impLibPath;
+ EnsureParentDirectoryExists(impLibPath);
}
cmMakefile* mf = this->GetMakefile();
- if (mf->GetDefinition("MSVC_C_ARCHITECTURE_ID") ||
- mf->GetDefinition("MSVC_CXX_ARCHITECTURE_ID"))
- {
- path = this->GetTargetPDB();
- vars["TARGET_PDB"] = this->GetLocalGenerator()->ConvertToOutputFormat(
- ConvertToNinjaPath(path.c_str()).c_str(),
- cmLocalGenerator::SHELL);
- EnsureParentDirectoryExists(path);
- }
- else
+ if (!this->SetMsvcTargetPdbVariable(vars))
{
// It is common to place debug symbols at a specific place,
// so we need a plain target name in the rule available.
@@ -494,9 +485,9 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement()
if (mf->IsOn("CMAKE_COMPILER_IS_MINGW"))
{
- path = GetTarget()->GetSupportDirectory();
- vars["OBJECT_DIR"] = ConvertToNinjaPath(path.c_str());
- EnsureDirectoryExists(path);
+ const std::string objPath = GetTarget()->GetSupportDirectory();
+ vars["OBJECT_DIR"] = ConvertToNinjaPath(objPath.c_str());
+ EnsureDirectoryExists(objPath);
// ar.exe can't handle backslashes in rsp files (implictly used by gcc)
std::string& linkLibraries = vars["LINK_LIBRARIES"];
std::replace(linkLibraries.begin(), linkLibraries.end(), '\\', '/');
@@ -527,10 +518,10 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement()
// If we have any PRE_LINK commands, we need to go back to HOME_OUTPUT for
// the link commands.
if (!preLinkCmdLines.empty()) {
- path = this->GetLocalGenerator()->ConvertToOutputFormat(
- this->GetMakefile()->GetHomeOutputDirectory(),
- cmLocalGenerator::SHELL);
- preLinkCmdLines.push_back("cd " + path);
+ const std::string homeOutDir = this->GetLocalGenerator()
+ ->ConvertToOutputFormat(this->GetMakefile()->GetHomeOutputDirectory(),
+ cmLocalGenerator::SHELL);
+ preLinkCmdLines.push_back("cd " + homeOutDir);
}
vars["PRE_LINK"] =