diff options
Diffstat (limited to 'Source/cmNinjaNormalTargetGenerator.cxx')
-rw-r--r-- | Source/cmNinjaNormalTargetGenerator.cxx | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/Source/cmNinjaNormalTargetGenerator.cxx b/Source/cmNinjaNormalTargetGenerator.cxx index 67a556d..a923d60 100644 --- a/Source/cmNinjaNormalTargetGenerator.cxx +++ b/Source/cmNinjaNormalTargetGenerator.cxx @@ -187,7 +187,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"; @@ -460,7 +467,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")) @@ -471,6 +477,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")) { @@ -532,7 +552,8 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement() int commandLineLengthLimit = 8000 - linkRuleLength; #elif defined(__linux) || defined(__APPLE__) // for instance ARG_MAX is 2096152 on Ubuntu or 262144 on Mac - int commandLineLengthLimit = sysconf(_SC_ARG_MAX) - linkRuleLength - 1000; + int commandLineLengthLimit = ((int)sysconf(_SC_ARG_MAX)) + - linkRuleLength - 1000; #else int commandLineLengthLimit = -1; #endif |