summaryrefslogtreecommitdiffstats
path: root/Source/cmNinjaNormalTargetGenerator.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'Source/cmNinjaNormalTargetGenerator.cxx')
-rw-r--r--Source/cmNinjaNormalTargetGenerator.cxx26
1 files changed, 15 insertions, 11 deletions
diff --git a/Source/cmNinjaNormalTargetGenerator.cxx b/Source/cmNinjaNormalTargetGenerator.cxx
index 2bad32c..bb8bd3f 100644
--- a/Source/cmNinjaNormalTargetGenerator.cxx
+++ b/Source/cmNinjaNormalTargetGenerator.cxx
@@ -152,6 +152,7 @@ cmNinjaNormalTargetGenerator
cmLocalGenerator::SHELL);
vars.ObjectDir = objdir.c_str();
vars.Target = "$out";
+ vars.SONameFlag = "$SONAME_FLAG";
vars.TargetSOName = "$SONAME";
vars.TargetInstallNameDir = "$INSTALLNAME_DIR";
vars.TargetPDB = "$TARGET_PDB";
@@ -366,17 +367,20 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement()
this->GetTarget(),
this->TargetLinkLanguage,
this->GetConfigName());
- vars["SONAME"] = this->TargetNameSO;
-
- if (targetType == cmTarget::SHARED_LIBRARY) {
- std::string install_name_dir =
- this->GetTarget()->GetInstallNameDirForBuildTree(this->GetConfigName());
-
- if (!install_name_dir.empty()) {
- vars["INSTALLNAME_DIR"] =
- this->GetLocalGenerator()->Convert(install_name_dir.c_str(),
- cmLocalGenerator::NONE,
- cmLocalGenerator::SHELL, false);
+ if (this->GetTarget()->HasSOName(this->GetConfigName())) {
+ vars["SONAME_FLAG"] =
+ this->GetMakefile()->GetSONameFlag(this->TargetLinkLanguage);
+ vars["SONAME"] = this->TargetNameSO;
+ if (targetType == cmTarget::SHARED_LIBRARY) {
+ std::string install_name_dir = this->GetTarget()
+ ->GetInstallNameDirForBuildTree(this->GetConfigName());
+
+ if (!install_name_dir.empty()) {
+ vars["INSTALLNAME_DIR"] =
+ this->GetLocalGenerator()->Convert(install_name_dir.c_str(),
+ cmLocalGenerator::NONE,
+ cmLocalGenerator::SHELL, false);
+ }
}
}