diff options
author | Stephen Kelly <steveire@gmail.com> | 2016-10-04 20:56:32 (GMT) |
---|---|---|
committer | Stephen Kelly <steveire@gmail.com> | 2016-10-06 18:02:10 (GMT) |
commit | 20e62f74c5a030a25fe1c3a6c835d67eea152d8f (patch) | |
tree | 8b6d869534acbd674cfb6794f02887b72a917a9d /Source | |
parent | fd93b3605bc931b5ce2386816973e106fa1ec646 (diff) | |
download | CMake-20e62f74c5a030a25fe1c3a6c835d67eea152d8f.zip CMake-20e62f74c5a030a25fe1c3a6c835d67eea152d8f.tar.gz CMake-20e62f74c5a030a25fe1c3a6c835d67eea152d8f.tar.bz2 |
cmLocalGenerator: Simplify ConvertToLinkReference
Make conversion to output format the caller responsibility, so that the
method only 'converts to a link reference'.
Diffstat (limited to 'Source')
-rw-r--r-- | Source/cmCommonTargetGenerator.cxx | 6 | ||||
-rw-r--r-- | Source/cmLocalGenerator.cxx | 13 | ||||
-rw-r--r-- | Source/cmLocalGenerator.h | 4 | ||||
-rw-r--r-- | Source/cmLocalNinjaGenerator.cxx | 5 | ||||
-rw-r--r-- | Source/cmLocalNinjaGenerator.h | 4 |
5 files changed, 13 insertions, 19 deletions
diff --git a/Source/cmCommonTargetGenerator.cxx b/Source/cmCommonTargetGenerator.cxx index 6887a31..14ea1a9 100644 --- a/Source/cmCommonTargetGenerator.cxx +++ b/Source/cmCommonTargetGenerator.cxx @@ -75,8 +75,10 @@ void cmCommonTargetGenerator::AddModuleDefinitionFlag(std::string& flags) // Append the flag and value. Use ConvertToLinkReference to help // vs6's "cl -link" pass it to the linker. std::string flag = defFileFlag; - flag += (this->LocalGenerator->ConvertToLinkReference( - this->ModuleDefinitionFile->GetFullPath())); + flag += this->LocalGenerator->ConvertToOutputFormat( + this->LocalGenerator->ConvertToLinkReference( + this->ModuleDefinitionFile->GetFullPath()), + cmOutputConverter::SHELL); this->LocalGenerator->AppendFlags(flags, flag); } diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx index f24b717..b2569a2 100644 --- a/Source/cmLocalGenerator.cxx +++ b/Source/cmLocalGenerator.cxx @@ -1374,8 +1374,7 @@ std::string cmLocalGenerator::GetTargetFortranFlags( return std::string(); } -std::string cmLocalGenerator::ConvertToLinkReference(std::string const& lib, - OutputFormat format) +std::string cmLocalGenerator::ConvertToLinkReference(std::string const& lib) { #if defined(_WIN32) && !defined(__CYGWIN__) // Work-ardound command line parsing limitations in MSVC 6.0 @@ -1392,17 +1391,14 @@ std::string cmLocalGenerator::ConvertToLinkReference(std::string const& lib, // Append the rest of the path with no space. sp += lib.substr(pos); - // Convert to an output path. - return this->ConvertToOutputFormat(sp.c_str(), format); + return sp; } } } #endif // Normal behavior. - return this->ConvertToOutputFormat( - this->ConvertToRelativePath(this->GetCurrentBinaryDirectory(), lib), - format); + return this->ConvertToRelativePath(this->GetCurrentBinaryDirectory(), lib); } /** @@ -1517,7 +1513,8 @@ void cmLocalGenerator::OutputLinkLibraries(std::string& linkLibraries, continue; } if (li->IsPath) { - linkLibs += this->ConvertToLinkReference(li->Value, shellFormat); + linkLibs += this->ConvertToOutputFormat( + this->ConvertToLinkReference(li->Value), shellFormat); } else { linkLibs += li->Value; } diff --git a/Source/cmLocalGenerator.h b/Source/cmLocalGenerator.h index 19469be..703a507 100644 --- a/Source/cmLocalGenerator.h +++ b/Source/cmLocalGenerator.h @@ -367,9 +367,7 @@ protected: std::string& CreateSafeUniqueObjectFileName(const std::string& sin, std::string const& dir_max); - virtual std::string ConvertToLinkReference( - std::string const& lib, - cmOutputConverter::OutputFormat format = cmOutputConverter::SHELL); + virtual std::string ConvertToLinkReference(std::string const& lib); /** Check whether the native build system supports the given definition. Issues a warning. */ diff --git a/Source/cmLocalNinjaGenerator.cxx b/Source/cmLocalNinjaGenerator.cxx index 11b87e3..5736581 100644 --- a/Source/cmLocalNinjaGenerator.cxx +++ b/Source/cmLocalNinjaGenerator.cxx @@ -121,10 +121,9 @@ cmGlobalNinjaGenerator* cmLocalNinjaGenerator::GetGlobalNinjaGenerator() // Virtual protected methods. std::string cmLocalNinjaGenerator::ConvertToLinkReference( - std::string const& lib, cmOutputConverter::OutputFormat format) + std::string const& lib) { - std::string path = this->GetGlobalNinjaGenerator()->ConvertToNinjaPath(lib); - return this->ConvertToOutputFormat(path, format); + return this->GetGlobalNinjaGenerator()->ConvertToNinjaPath(lib); } std::string cmLocalNinjaGenerator::ConvertToIncludeReference( diff --git a/Source/cmLocalNinjaGenerator.h b/Source/cmLocalNinjaGenerator.h index 875f8c6..3061b57 100644 --- a/Source/cmLocalNinjaGenerator.h +++ b/Source/cmLocalNinjaGenerator.h @@ -76,9 +76,7 @@ public: void AppendCustomCommandDeps(cmCustomCommandGenerator const& ccg, cmNinjaDeps& ninjaDeps); - std::string ConvertToLinkReference(std::string const& lib, - cmOutputConverter::OutputFormat format = - cmOutputConverter::SHELL) CM_OVERRIDE; + std::string ConvertToLinkReference(std::string const& lib) CM_OVERRIDE; void ComputeObjectFilenames( std::map<cmSourceFile const*, std::string>& mapping, |