summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2019-07-16 14:30:30 (GMT)
committerKitware Robot <kwrobot@kitware.com>2019-07-16 14:30:38 (GMT)
commitc3d9d800157a8fe2c0478d7e054544b99694c240 (patch)
treee723f303f577f058be0b5771053dbee027e6c32e /Source
parent76a540bab5f05e4d523ce1b0480b0ee6424c676b (diff)
parentc2c3d22504728e0763c3d0e88333a34d24457fb6 (diff)
downloadCMake-c3d9d800157a8fe2c0478d7e054544b99694c240.zip
CMake-c3d9d800157a8fe2c0478d7e054544b99694c240.tar.gz
CMake-c3d9d800157a8fe2c0478d7e054544b99694c240.tar.bz2
Merge topic 'aix-explicit-exports'
c2c3d22504 Tests: Drop RunCMake workaround for AIX ld warnings about GNU atexit 9f5c2040bf AIX: Explicitly compute executable exports for both XL and GNU 0f150b69d3 AIX: Explicitly compute shared object exports for both XL and GNU a5bf4e7921 AIX: Drop redundant -brtl flags 9cb5f040d7 XL: De-duplicate shared object creation flags Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !3556
Diffstat (limited to 'Source')
-rw-r--r--Source/cmGeneratorTarget.cxx7
-rw-r--r--Source/cmLocalGenerator.cxx12
-rw-r--r--Source/cmTarget.cxx11
-rw-r--r--Source/cmTarget.h3
4 files changed, 29 insertions, 4 deletions
diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx
index c807f6d..a2c0503 100644
--- a/Source/cmGeneratorTarget.cxx
+++ b/Source/cmGeneratorTarget.cxx
@@ -2754,6 +2754,13 @@ std::string cmGeneratorTarget::GetCreateRuleVariable(
case cmStateEnums::MODULE_LIBRARY:
return "CMAKE_" + lang + "_CREATE_SHARED_MODULE";
case cmStateEnums::EXECUTABLE:
+ if (this->IsExecutableWithExports()) {
+ std::string linkExeWithExports =
+ "CMAKE_" + lang + "_LINK_EXECUTABLE_WITH_EXPORTS";
+ if (this->Makefile->IsDefinitionSet(linkExeWithExports)) {
+ return linkExeWithExports;
+ }
+ }
return "CMAKE_" + lang + "_LINK_EXECUTABLE";
default:
break;
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx
index 0f730c9..4ffd6e0 100644
--- a/Source/cmLocalGenerator.cxx
+++ b/Source/cmLocalGenerator.cxx
@@ -1515,8 +1515,10 @@ std::string cmLocalGenerator::GetLinkLibsCMP0065(
}
CM_FALLTHROUGH;
case cmPolicies::OLD:
- // OLD behavior is to always add the flags
- add_shlib_flags = true;
+ // OLD behavior is to always add the flags, except on AIX where
+ // we compute symbol exports if ENABLE_EXPORTS is on.
+ add_shlib_flags =
+ !(tgt.Target->IsAIX() && tgt.GetPropertyAsBool("ENABLE_EXPORTS"));
break;
case cmPolicies::REQUIRED_IF_USED:
case cmPolicies::REQUIRED_ALWAYS:
@@ -1525,8 +1527,10 @@ std::string cmLocalGenerator::GetLinkLibsCMP0065(
cmPolicies::GetRequiredPolicyError(cmPolicies::CMP0065));
CM_FALLTHROUGH;
case cmPolicies::NEW:
- // NEW behavior is to only add the flags if ENABLE_EXPORTS is on
- add_shlib_flags = tgt.GetPropertyAsBool("ENABLE_EXPORTS");
+ // NEW behavior is to only add the flags if ENABLE_EXPORTS is on,
+ // except on AIX where we compute symbol exports.
+ add_shlib_flags =
+ !tgt.Target->IsAIX() && tgt.GetPropertyAsBool("ENABLE_EXPORTS");
break;
}
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index 773487e..9290d27 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -171,6 +171,7 @@ public:
bool IsGeneratorProvided;
bool HaveInstallRule;
bool IsDLLPlatform;
+ bool IsAIX;
bool IsAndroid;
bool IsImportedTarget;
bool ImportedGloballyVisible;
@@ -219,6 +220,7 @@ cmTarget::cmTarget(std::string const& name, cmStateEnums::TargetType type,
impl->IsGeneratorProvided = false;
impl->HaveInstallRule = false;
impl->IsDLLPlatform = false;
+ impl->IsAIX = false;
impl->IsAndroid = false;
impl->IsImportedTarget =
(vis == VisibilityImported || vis == VisibilityImportedGlobally);
@@ -229,6 +231,10 @@ cmTarget::cmTarget(std::string const& name, cmStateEnums::TargetType type,
impl->IsDLLPlatform =
!impl->Makefile->GetSafeDefinition("CMAKE_IMPORT_LIBRARY_SUFFIX").empty();
+ // Check whether we are targeting AIX.
+ impl->IsAIX =
+ (impl->Makefile->GetSafeDefinition("CMAKE_SYSTEM_NAME") == "AIX");
+
// Check whether we are targeting an Android platform.
impl->IsAndroid =
(impl->Makefile->GetSafeDefinition("CMAKE_SYSTEM_NAME") == "Android");
@@ -1664,6 +1670,11 @@ bool cmTarget::IsDLLPlatform() const
return impl->IsDLLPlatform;
}
+bool cmTarget::IsAIX() const
+{
+ return impl->IsAIX;
+}
+
bool cmTarget::IsImported() const
{
return impl->IsImportedTarget;
diff --git a/Source/cmTarget.h b/Source/cmTarget.h
index d9e87b8..a808bb4 100644
--- a/Source/cmTarget.h
+++ b/Source/cmTarget.h
@@ -180,6 +180,9 @@ public:
//! Return whether or not the target is for a DLL platform.
bool IsDLLPlatform() const;
+ //! Return whether or not we are targeting AIX.
+ bool IsAIX() const;
+
bool IsImported() const;
bool IsImportedGloballyVisible() const;