summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorBill Hoffman <bill.hoffman@kitware.com>2003-07-03 16:50:41 (GMT)
committerBill Hoffman <bill.hoffman@kitware.com>2003-07-03 16:50:41 (GMT)
commitf22a4a908ddf52f7c6fd3d9cdedd43eaeda734f0 (patch)
tree8b40633ab8d32a7fec422bc8571afeee20f05831 /Source
parent711febc82d45cb9fdced4a1f511e4bb469497b32 (diff)
downloadCMake-f22a4a908ddf52f7c6fd3d9cdedd43eaeda734f0.zip
CMake-f22a4a908ddf52f7c6fd3d9cdedd43eaeda734f0.tar.gz
CMake-f22a4a908ddf52f7c6fd3d9cdedd43eaeda734f0.tar.bz2
ENH: add linker flags
Diffstat (limited to 'Source')
-rw-r--r--Source/cmLocalVisualStudio7Generator.cxx32
1 files changed, 26 insertions, 6 deletions
diff --git a/Source/cmLocalVisualStudio7Generator.cxx b/Source/cmLocalVisualStudio7Generator.cxx
index 58621e4..dbde4a7 100644
--- a/Source/cmLocalVisualStudio7Generator.cxx
+++ b/Source/cmLocalVisualStudio7Generator.cxx
@@ -380,9 +380,29 @@ void cmLocalVisualStudio7Generator::OutputBuildTool(std::ostream& fout,
if (debug && m_Makefile->GetDefinition("CMAKE_DEBUG_POSTFIX"))
{
debugPostfix = m_Makefile->GetDefinition("CMAKE_DEBUG_POSTFIX");
+ }
+
+ std::string extraLinkOptions;
+ if(target.GetType() == cmTarget::EXECUTABLE)
+ {
+ extraLinkOptions = m_Makefile->GetDefinition("CMAKE_EXE_LINKER_FLAGS");
+ }
+ if(target.GetType() == cmTarget::SHARED_LIBRARY)
+ {
+ extraLinkOptions = m_Makefile->GetDefinition("CMAKE_SHARED_LINKER_FLAGS");
+ }
+ if(target.GetType() == cmTarget::MODULE_LIBRARY)
+ {
+ extraLinkOptions = m_Makefile->GetDefinition("CMAKE_MODULE_LINKER_FLAGS");
}
+
const char* targetLinkFlags = target.GetProperty("LINK_FLAGS");
-
+ if(targetLinkFlags)
+ {
+ extraLinkOptions += " ";
+ extraLinkOptions += targetLinkFlags;
+ }
+
switch(target.GetType())
{
case cmTarget::STATIC_LIBRARY:
@@ -400,10 +420,10 @@ void cmLocalVisualStudio7Generator::OutputBuildTool(std::ostream& fout,
fout << "\t\t\t<Tool\n"
<< "\t\t\t\tName=\"VCLinkerTool\"\n"
<< "\t\t\t\tAdditionalOptions=\"/MACHINE:I386";
- if(targetLinkFlags)
+ if(extraLinkOptions.size())
{
fout << " " << cmLocalVisualStudio7Generator::EscapeForXML(
- targetLinkFlags).c_str();
+ extraLinkOptions.c_str()).c_str();
}
fout << "\"\n"
<< "\t\t\t\tAdditionalDependencies=\" odbc32.lib odbccp32.lib ";
@@ -450,11 +470,11 @@ void cmLocalVisualStudio7Generator::OutputBuildTool(std::ostream& fout,
fout << "\t\t\t<Tool\n"
<< "\t\t\t\tName=\"VCLinkerTool\"\n"
- << "\t\t\t\tAdditionalOptions=\"/MACHINE:I386";
- if(targetLinkFlags)
+ << "\t\t\t\tAdditionalOptions=\"/MACHINE:I386";
+ if(extraLinkOptions.size())
{
fout << " " << cmLocalVisualStudio7Generator::EscapeForXML(
- targetLinkFlags).c_str();
+ extraLinkOptions.c_str()).c_str();
}
fout << "\"\n"
<< "\t\t\t\tAdditionalDependencies=\" odbc32.lib odbccp32.lib ";