summaryrefslogtreecommitdiffstats
path: root/Source/cmLocalVisualStudio7Generator.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2006-01-27 18:48:21 (GMT)
committerBrad King <brad.king@kitware.com>2006-01-27 18:48:21 (GMT)
commitf4b306d5d449b8b5959c2d32898bd9fd23b893c6 (patch)
treeb04862ff0db6409c563f3ffd44a26a5fd3586609 /Source/cmLocalVisualStudio7Generator.cxx
parent04c705bc017f4faa4743fc26c840ee890a0f0838 (diff)
downloadCMake-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/cmLocalVisualStudio7Generator.cxx')
-rw-r--r--Source/cmLocalVisualStudio7Generator.cxx21
1 files changed, 18 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");