From ae8124a04c414ebd11dd411bc3296849e3373157 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Peter=20K=C3=BCmmel?= Date: Mon, 16 Jul 2012 14:16:43 +0200 Subject: Ninja: also mingw needs TARGET_PDB --- Source/cmNinjaNormalTargetGenerator.cxx | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Source/cmNinjaNormalTargetGenerator.cxx b/Source/cmNinjaNormalTargetGenerator.cxx index be7739e..19f0342 100644 --- a/Source/cmNinjaNormalTargetGenerator.cxx +++ b/Source/cmNinjaNormalTargetGenerator.cxx @@ -434,6 +434,15 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement() cmLocalGenerator::SHELL); EnsureParentDirectoryExists(path); } + else + { + // It is common to place debug symbols at a specific place, + // so we need a plain target name in the rule available. + // TODO: Makefile generator could use because it expands + // to the plain target name, here it expands to a relative path. + // This difference could make trouble when switching to Ninja generator. + vars["TARGET_PDB"] = std::string(this->GetTarget()->GetName()); + } if (mf->IsOn("CMAKE_COMPILER_IS_MINGW")) { -- cgit v0.12 From e5a27a44a7a400e62a5f64450ae2c4d3d2b91e5c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Peter=20K=C3=BCmmel?= Date: Mon, 16 Jul 2012 18:16:01 +0200 Subject: Ninja: line length --- Source/cmNinjaNormalTargetGenerator.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/cmNinjaNormalTargetGenerator.cxx b/Source/cmNinjaNormalTargetGenerator.cxx index 19f0342..265b28a 100644 --- a/Source/cmNinjaNormalTargetGenerator.cxx +++ b/Source/cmNinjaNormalTargetGenerator.cxx @@ -440,7 +440,7 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement() // so we need a plain target name in the rule available. // TODO: Makefile generator could use because it expands // to the plain target name, here it expands to a relative path. - // This difference could make trouble when switching to Ninja generator. + // This difference could make trouble when switching to Ninja generator. vars["TARGET_PDB"] = std::string(this->GetTarget()->GetName()); } -- cgit v0.12 From 75bbffbe1b66070df8ac68f1d8b556e7cb0d087c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Peter=20K=C3=BCmmel?= Date: Tue, 17 Jul 2012 11:21:03 +0200 Subject: Ninja: make TARGET_PDB a real .gdb file name --- Source/cmNinjaNormalTargetGenerator.cxx | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/Source/cmNinjaNormalTargetGenerator.cxx b/Source/cmNinjaNormalTargetGenerator.cxx index 265b28a..6d13a9a 100644 --- a/Source/cmNinjaNormalTargetGenerator.cxx +++ b/Source/cmNinjaNormalTargetGenerator.cxx @@ -174,7 +174,14 @@ cmNinjaNormalTargetGenerator } vars.ObjectDir = "$OBJECT_DIR"; + + // TODO: + // Makefile generator expands to the plain target name + // with suffix. $out expands to a relative path. This difference + // could make trouble when switching to Ninja generator. Maybe + // using TARGET_NAME and RuleVariables::TargetName is a fix. vars.Target = "$out"; + vars.SONameFlag = "$SONAME_FLAG"; vars.TargetSOName = "$SONAME"; vars.TargetInstallNameDir = "$INSTALLNAME_DIR"; @@ -423,7 +430,6 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement() EnsureParentDirectoryExists(path); } - // TODO move to GetTargetPDB cmMakefile* mf = this->GetMakefile(); if (mf->GetDefinition("MSVC_C_ARCHITECTURE_ID") || mf->GetDefinition("MSVC_CXX_ARCHITECTURE_ID")) @@ -438,10 +444,10 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement() { // It is common to place debug symbols at a specific place, // so we need a plain target name in the rule available. - // TODO: Makefile generator could use because it expands - // to the plain target name, here it expands to a relative path. - // This difference could make trouble when switching to Ninja generator. - vars["TARGET_PDB"] = std::string(this->GetTarget()->GetName()); + std::string base; + std::string suffix; + this->GetTarget()->GetFullNameComponents(std::string(), base, suffix); + vars["TARGET_PDB"] = base + suffix + ".gdb"; } if (mf->IsOn("CMAKE_COMPILER_IS_MINGW")) -- cgit v0.12 From 0a3d6a19b7355218ebc6de61a501626fa2aceb33 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Peter=20K=C3=BCmmel?= Date: Tue, 17 Jul 2012 11:45:19 +0200 Subject: Ninja: make debug symbol suffix configurable by CMAKE_DEBUG_SYMBOL_SUFFIX --- Source/cmNinjaNormalTargetGenerator.cxx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Source/cmNinjaNormalTargetGenerator.cxx b/Source/cmNinjaNormalTargetGenerator.cxx index 6d13a9a..d832a4b 100644 --- a/Source/cmNinjaNormalTargetGenerator.cxx +++ b/Source/cmNinjaNormalTargetGenerator.cxx @@ -447,7 +447,11 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement() std::string base; std::string suffix; this->GetTarget()->GetFullNameComponents(std::string(), base, suffix); - vars["TARGET_PDB"] = base + suffix + ".gdb"; + std::string dbg_suffix = ".dbg"; + // TODO: Where to document? + if (mf->GetDefinition("CMAKE_DEBUG_SYMBOL_SUFFIX")) + dbg_suffix = mf->GetDefinition("CMAKE_DEBUG_SYMBOL_SUFFIX"); + vars["TARGET_PDB"] = base + suffix + dbg_suffix; } if (mf->IsOn("CMAKE_COMPILER_IS_MINGW")) -- cgit v0.12 From 9e30289176c1aaee4df14e452e6590187355040f Mon Sep 17 00:00:00 2001 From: Nicolas Despres Date: Wed, 18 Jul 2012 10:50:57 +0200 Subject: Ninja: Cannot pass a reference to an anonymous object. --- Source/cmNinjaNormalTargetGenerator.cxx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Source/cmNinjaNormalTargetGenerator.cxx b/Source/cmNinjaNormalTargetGenerator.cxx index d832a4b..4c35d25 100644 --- a/Source/cmNinjaNormalTargetGenerator.cxx +++ b/Source/cmNinjaNormalTargetGenerator.cxx @@ -444,9 +444,10 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement() { // It is common to place debug symbols at a specific place, // so we need a plain target name in the rule available. + std::string prefix; std::string base; std::string suffix; - this->GetTarget()->GetFullNameComponents(std::string(), base, suffix); + this->GetTarget()->GetFullNameComponents(prefix, base, suffix); std::string dbg_suffix = ".dbg"; // TODO: Where to document? if (mf->GetDefinition("CMAKE_DEBUG_SYMBOL_SUFFIX")) -- cgit v0.12