diff options
author | Chuck Atkins <chuck.atkins@kitware.com> | 2015-09-29 11:34:18 -0500 |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2015-09-30 14:59:11 -0400 |
commit | e90f463a312e18fd6498799de1522b96d84fd012 (patch) | |
tree | 87e738356006380581ba74a68544a443fa901756 | |
parent | 5c50b396865c2fbd61cf43c5c4c287113208f32c (diff) | |
download | cmake-e90f463a312e18fd6498799de1522b96d84fd012.tar.gz |
Drop executable symbol export if platform does not support shared libs
Instead of always adding CMAKE_SHARED_LIBRARY_LINK_<LANG>_FLAGS to
executables, or just when the ENABLE_EXPORTS property is set (CMP0065),
make sure that the target platform also actually supports shared
libraries. If not, then the executable cannot possibly provide symbols
to them anyway.
-rw-r--r-- | Source/cmLocalGenerator.cxx | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx index f4de0f2660..32304032d0 100644 --- a/Source/cmLocalGenerator.cxx +++ b/Source/cmLocalGenerator.cxx @@ -1542,7 +1542,9 @@ void cmLocalGenerator::OutputLinkLibraries(std::string& linkLibraries, this->Makefile->GetSafeDefinition("CMAKE_LIBRARY_PATH_TERMINATOR"); // Flags to link an executable to shared libraries. - if( tgt.GetType() == cmTarget::EXECUTABLE ) + if (tgt.GetType() == cmTarget::EXECUTABLE && + this->StateSnapshot.GetState()-> + GetGlobalPropertyAsBool("TARGET_SUPPORTS_SHARED_LIBS")) { bool add_shlib_flags = false; switch(tgt.Target->GetPolicyStatusCMP0065()) |