diff options
author | Brad King <brad.king@kitware.com> | 2002-11-12 17:47:44 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2002-11-12 17:47:44 (GMT) |
commit | c8ced2aca6dd782289afcb6e7b392af679bfe5ac (patch) | |
tree | 6ba850c89d4a6e4b46d1c57ce2df22ea5669e31d /Source | |
parent | 1d7c2eaf909745ef4e0d8bc8d09df336fab08f49 (diff) | |
download | CMake-c8ced2aca6dd782289afcb6e7b392af679bfe5ac.zip CMake-c8ced2aca6dd782289afcb6e7b392af679bfe5ac.tar.gz CMake-c8ced2aca6dd782289afcb6e7b392af679bfe5ac.tar.bz2 |
*** empty log message ***
Diffstat (limited to 'Source')
-rw-r--r-- | Source/cmLocalUnixMakefileGenerator.cxx | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/Source/cmLocalUnixMakefileGenerator.cxx b/Source/cmLocalUnixMakefileGenerator.cxx index 5eb60dc..de42983 100644 --- a/Source/cmLocalUnixMakefileGenerator.cxx +++ b/Source/cmLocalUnixMakefileGenerator.cxx @@ -462,26 +462,11 @@ void cmLocalUnixMakefileGenerator::OutputLinkLibraries(std::ostream& fout, // if linking a c executable use the C runtime flag as cc // may not be the same program that creates shared libaries // and may have different flags - if( tgt.GetType() == cmTarget::EXECUTABLE) - { - runtimeFlag = this->GetSafeDefinition("CMAKE_SHARED_LIBRARY_LINK_FLAGS"); - } - else - { - runtimeFlag = this->GetSafeDefinition("CMAKE_SHARED_LIBRARY_RUNTIME_FLAG"); - } + runtimeFlag = this->GetSafeDefinition("CMAKE_SHARED_LIBRARY_RUNTIME_FLAG"); runtimeSep = this->GetSafeDefinition("CMAKE_SHARED_LIBRARY_RUNTIME_FLAG_SEP"); } else { - if( tgt.GetType() == cmTarget::EXECUTABLE) - { - runtimeFlag = this->GetSafeDefinition("CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS"); - } - else - { - runtimeFlag = this->GetSafeDefinition("CMAKE_SHARED_LIBRARY_RUNTIME_CXX_FLAG"); - } runtimeFlag = this->GetSafeDefinition("CMAKE_SHARED_LIBRARY_RUNTIME_CXX_FLAG"); runtimeSep = this->GetSafeDefinition("CMAKE_SHARED_LIBRARY_RUNTIME_CXX_FLAG_SEP"); } @@ -500,6 +485,21 @@ void cmLocalUnixMakefileGenerator::OutputLinkLibraries(std::ostream& fout, std::string libLinkFlag = this->GetSafeDefinition("CMAKE_LINK_LIBRARY_FLAG"); // collect all the flags needed for linking libraries std::string linkLibs; + + // Flags to link an executable to shared libraries. + if( tgt.GetType() == cmTarget::EXECUTABLE) + { + if(cxx) + { + linkLibs = this->GetSafeDefinition("CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS"); + } + else + { + linkLibs = this->GetSafeDefinition("CMAKE_SHARED_LIBRARY_LINK_FLAGS"); + } + linkLibs += " "; + } + const std::vector<std::string>& libdirs = tgt.GetLinkDirectories(); for(std::vector<std::string>::const_iterator libDir = libdirs.begin(); libDir != libdirs.end(); ++libDir) |