diff options
author | Alexander Stein <alexander.stein@mailbox.org> | 2021-03-04 19:33:07 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2021-03-04 20:44:49 (GMT) |
commit | c0a33174970c7d0adb2d49287b0aab5aa9432e4e (patch) | |
tree | 23cce8e5d4ef80e324fc04b06358249c04f919a6 /Source/cmNinjaNormalTargetGenerator.cxx | |
parent | 9dfa7981d54b32067b7a797ab68ac52055b47e2b (diff) | |
download | CMake-c0a33174970c7d0adb2d49287b0aab5aa9432e4e.zip CMake-c0a33174970c7d0adb2d49287b0aab5aa9432e4e.tar.gz CMake-c0a33174970c7d0adb2d49287b0aab5aa9432e4e.tar.bz2 |
Ninja: 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 was already done for soname symlink creation in commit 13c92b4a30
(Ninja: Fix creation of library symlinks in folders with spaces,
2019-05-20, v3.15.0-rc1~87^2).
Fixes: #20331
Diffstat (limited to 'Source/cmNinjaNormalTargetGenerator.cxx')
-rw-r--r-- | Source/cmNinjaNormalTargetGenerator.cxx | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/Source/cmNinjaNormalTargetGenerator.cxx b/Source/cmNinjaNormalTargetGenerator.cxx index 49e5e4c..1d511f2 100644 --- a/Source/cmNinjaNormalTargetGenerator.cxx +++ b/Source/cmNinjaNormalTargetGenerator.cxx @@ -868,7 +868,8 @@ void cmNinjaNormalTargetGenerator::WriteNvidiaDeviceLinkStatement( if (genTarget->HasSOName(config)) { vars["SONAME_FLAG"] = this->GetMakefile()->GetSONameFlag(this->TargetLinkLanguage(config)); - vars["SONAME"] = tgtNames.SharedObject; + vars["SONAME"] = localGen.ConvertToOutputFormat(tgtNames.SharedObject, + cmOutputConverter::SHELL); if (genTarget->GetType() == cmStateEnums::SHARED_LIBRARY) { std::string install_dir = this->GetGeneratorTarget()->GetInstallNameDirForBuildTree(config); @@ -1176,7 +1177,8 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement( } if (gt->HasSOName(config)) { vars["SONAME_FLAG"] = mf->GetSONameFlag(this->TargetLinkLanguage(config)); - vars["SONAME"] = tgtNames.SharedObject; + vars["SONAME"] = localGen.ConvertToOutputFormat(tgtNames.SharedObject, + cmOutputConverter::SHELL); if (targetType == cmStateEnums::SHARED_LIBRARY) { std::string install_dir = gt->GetInstallNameDirForBuildTree(config); if (!install_dir.empty()) { |