diff options
-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); |