diff options
author | Brad King <brad.king@kitware.com> | 2006-01-27 18:48:21 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2006-01-27 18:48:21 (GMT) |
commit | f4b306d5d449b8b5959c2d32898bd9fd23b893c6 (patch) | |
tree | b04862ff0db6409c563f3ffd44a26a5fd3586609 /Source | |
parent | 04c705bc017f4faa4743fc26c840ee890a0f0838 (diff) | |
download | CMake-f4b306d5d449b8b5959c2d32898bd9fd23b893c6.zip CMake-f4b306d5d449b8b5959c2d32898bd9fd23b893c6.tar.gz CMake-f4b306d5d449b8b5959c2d32898bd9fd23b893c6.tar.bz2 |
BUG: VS7 generator should use per-configuration linker flags for targets. This addresses bug#2765.
Diffstat (limited to 'Source')
-rw-r--r-- | Source/cmLocalVisualStudio7Generator.cxx | 21 | ||||
-rw-r--r-- | Source/cmLocalVisualStudio7Generator.h | 2 |
2 files changed, 20 insertions, 3 deletions
diff --git a/Source/cmLocalVisualStudio7Generator.cxx b/Source/cmLocalVisualStudio7Generator.cxx index 466154d..01eecde 100644 --- a/Source/cmLocalVisualStudio7Generator.cxx +++ b/Source/cmLocalVisualStudio7Generator.cxx @@ -658,7 +658,19 @@ void cmLocalVisualStudio7Generator::FillFlagMapFromCommandFlags( } } +//---------------------------------------------------------------------------- +std::string +cmLocalVisualStudio7Generator +::GetBuildTypeLinkerFlags(std::string rootLinkerFlags, const char* configName) +{ + std::string configTypeUpper = cmSystemTools::UpperCase(configName); + std::string extraLinkOptionsBuildTypeDef = rootLinkerFlags + "_" + configTypeUpper; + std::string extraLinkOptionsBuildType = + m_Makefile->GetRequiredDefinition(extraLinkOptionsBuildTypeDef.c_str()); + + return extraLinkOptionsBuildType; +} void cmLocalVisualStudio7Generator::OutputBuildTool(std::ostream& fout, const char* configName, @@ -670,15 +682,18 @@ void cmLocalVisualStudio7Generator::OutputBuildTool(std::ostream& fout, std::string extraLinkOptions; if(target.GetType() == cmTarget::EXECUTABLE) { - extraLinkOptions = m_Makefile->GetRequiredDefinition("CMAKE_EXE_LINKER_FLAGS"); + extraLinkOptions = m_Makefile->GetRequiredDefinition("CMAKE_EXE_LINKER_FLAGS") + + std::string(" ") + GetBuildTypeLinkerFlags("CMAKE_EXE_LINKER_FLAGS", configName); } if(target.GetType() == cmTarget::SHARED_LIBRARY) { - extraLinkOptions = m_Makefile->GetRequiredDefinition("CMAKE_SHARED_LINKER_FLAGS"); + extraLinkOptions = m_Makefile->GetRequiredDefinition("CMAKE_SHARED_LINKER_FLAGS") + + std::string(" ") + GetBuildTypeLinkerFlags("CMAKE_SHARED_LINKER_FLAGS", configName); } if(target.GetType() == cmTarget::MODULE_LIBRARY) { - extraLinkOptions = m_Makefile->GetRequiredDefinition("CMAKE_MODULE_LINKER_FLAGS"); + extraLinkOptions = m_Makefile->GetRequiredDefinition("CMAKE_MODULE_LINKER_FLAGS") + + std::string(" ") + GetBuildTypeLinkerFlags("CMAKE_MODULE_LINKER_FLAGS", configName); } const char* targetLinkFlags = target.GetProperty("LINK_FLAGS"); diff --git a/Source/cmLocalVisualStudio7Generator.h b/Source/cmLocalVisualStudio7Generator.h index 36dafa6..6a83e3b 100644 --- a/Source/cmLocalVisualStudio7Generator.h +++ b/Source/cmLocalVisualStudio7Generator.h @@ -67,6 +67,8 @@ private: void FillFlagMapFromCommandFlags(std::map<cmStdString, cmStdString>& flagMap, cmVS7FlagTable* flagTable, std::string& flags); + std::string GetBuildTypeLinkerFlags(std::string rootLinkerFlags, + const char* configName); void OutputVCProjFile(); void WriteVCProjHeader(std::ostream& fout, const char *libName, cmTarget &tgt, std::vector<cmSourceGroup> &sgs); |