summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Stein <alexander.stein@mailbox.org>2021-03-04 19:43:34 (GMT)
committerBrad King <brad.king@kitware.com>2021-03-04 20:44:48 (GMT)
commit9dfa7981d54b32067b7a797ab68ac52055b47e2b (patch)
tree32e7e95e2bba83b64f1f54dbd69c9e90b5aa0eae
parent5025b568433d6b7027b81822f1782defb80be74a (diff)
downloadCMake-9dfa7981d54b32067b7a797ab68ac52055b47e2b.zip
CMake-9dfa7981d54b32067b7a797ab68ac52055b47e2b.tar.gz
CMake-9dfa7981d54b32067b7a797ab68ac52055b47e2b.tar.bz2
Makefiles: Escape SONAME on linker command line
If the shared object name contains spaces, they need to be properly escaped, or link command will fail.
-rw-r--r--Source/cmMakefileLibraryTargetGenerator.cxx5
1 files changed, 4 insertions, 1 deletions
diff --git a/Source/cmMakefileLibraryTargetGenerator.cxx b/Source/cmMakefileLibraryTargetGenerator.cxx
index ce64e2c..5e4f03d 100644
--- a/Source/cmMakefileLibraryTargetGenerator.cxx
+++ b/Source/cmMakefileLibraryTargetGenerator.cxx
@@ -780,9 +780,12 @@ void cmMakefileLibraryTargetGenerator::WriteLibraryRules(
vars.Target = target.c_str();
vars.LinkLibraries = linkLibs.c_str();
vars.ObjectsQuoted = buildObjs.c_str();
+ std::string targetOutSOName;
if (this->GeneratorTarget->HasSOName(this->GetConfigName())) {
vars.SONameFlag = this->Makefile->GetSONameFlag(linkLanguage);
- vars.TargetSOName = this->TargetNames.SharedObject.c_str();
+ targetOutSOName = this->LocalGenerator->ConvertToOutputFormat(
+ this->TargetNames.SharedObject.c_str(), cmOutputConverter::SHELL);
+ vars.TargetSOName = targetOutSOName.c_str();
}
vars.LinkFlags = linkFlags.c_str();