diff options
author | David Cole <david.cole@kitware.com> | 2012-07-24 21:03:13 (GMT) |
---|---|---|
committer | CMake Topic Stage <kwrobot@kitware.com> | 2012-07-24 21:03:13 (GMT) |
commit | 0f87f32fe39140d52bdf0f03289ad468ea4009c0 (patch) | |
tree | 81ed9f9d3a46d281691ab433a62008641405e39a /Source/cmNinjaNormalTargetGenerator.cxx | |
parent | a195ca98ba16c0b55ccb17639a7edfd15c8ddc2c (diff) | |
parent | 9e30289176c1aaee4df14e452e6590187355040f (diff) | |
download | CMake-0f87f32fe39140d52bdf0f03289ad468ea4009c0.zip CMake-0f87f32fe39140d52bdf0f03289ad468ea4009c0.tar.gz CMake-0f87f32fe39140d52bdf0f03289ad468ea4009c0.tar.bz2 |
Merge topic 'ninja-mingw-TARGET_PDB'
9e30289 Ninja: Cannot pass a reference to an anonymous object.
0a3d6a1 Ninja: make debug symbol suffix configurable by CMAKE_DEBUG_SYMBOL_SUFFIX
75bbffb Ninja: make TARGET_PDB a real .gdb file name
e5a27a4 Ninja: line length
ae8124a Ninja: also mingw needs TARGET_PDB
Diffstat (limited to 'Source/cmNinjaNormalTargetGenerator.cxx')
-rw-r--r-- | Source/cmNinjaNormalTargetGenerator.cxx | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/Source/cmNinjaNormalTargetGenerator.cxx b/Source/cmNinjaNormalTargetGenerator.cxx index 5c9bf78..7805fe8 100644 --- a/Source/cmNinjaNormalTargetGenerator.cxx +++ b/Source/cmNinjaNormalTargetGenerator.cxx @@ -174,7 +174,14 @@ cmNinjaNormalTargetGenerator } vars.ObjectDir = "$OBJECT_DIR"; + + // TODO: + // Makefile generator expands <TARGET> 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")) @@ -434,6 +440,20 @@ 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. + std::string prefix; + std::string base; + std::string suffix; + this->GetTarget()->GetFullNameComponents(prefix, base, suffix); + 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")) { |