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.
This commit is contained in:
Alexander Stein
2021-03-04 20:43:34 +01:00
committed by Brad King
parent 5025b56843
commit 9dfa7981d5

View File

@@ -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();