summaryrefslogtreecommitdiffstats
path: root/Source/cmNinjaNormalTargetGenerator.cxx
diff options
context:
space:
mode:
authorDavid Cole <david.cole@kitware.com>2012-05-01 18:09:59 (GMT)
committerCMake Topic Stage <kwrobot@kitware.com>2012-05-01 18:09:59 (GMT)
commit8df7aa54f0f78d48e4ed91001ac9ac9d39dbf535 (patch)
treecfde4039510819e096c2bf197cfdc6e7827b6b0d /Source/cmNinjaNormalTargetGenerator.cxx
parentd05e12bc166d4285ccd5e961bd48cc6eb95bc77f (diff)
parentfdb3f878fec158ab284130a55849ada9edbd6fd1 (diff)
downloadCMake-8df7aa54f0f78d48e4ed91001ac9ac9d39dbf535.zip
CMake-8df7aa54f0f78d48e4ed91001ac9ac9d39dbf535.tar.gz
CMake-8df7aa54f0f78d48e4ed91001ac9ac9d39dbf535.tar.bz2
Merge topic 'module-no-soname'
fdb3f87 Test NO_SONAME property (#13155) e1409ac Support building shared libraries or modules without soname (#13155)
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 cf2b427..63ba58d 100644
--- a/Source/cmNinjaNormalTargetGenerator.cxx
+++ b/Source/cmNinjaNormalTargetGenerator.cxx
@@ -166,6 +166,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";
@@ -380,17 +381,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);
+ }
}
}