summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBill Hoffman <bill.hoffman@kitware.com>2007-01-23 15:50:05 (GMT)
committerBill Hoffman <bill.hoffman@kitware.com>2007-01-23 15:50:05 (GMT)
commitef9e460f65dd4d805f560f4f8f78c471d237ca36 (patch)
tree710e4b4b3061a24f2a3af216f35ccd288b35bf8d
parentc3ae42fc1eb6cf9d2c8252e994a2892a58e04670 (diff)
downloadCMake-ef9e460f65dd4d805f560f4f8f78c471d237ca36.zip
CMake-ef9e460f65dd4d805f560f4f8f78c471d237ca36.tar.gz
CMake-ef9e460f65dd4d805f560f4f8f78c471d237ca36.tar.bz2
ENH: add link flags for debug/release etc
-rw-r--r--Source/cmLocalVisualStudio6Generator.cxx66
1 files changed, 37 insertions, 29 deletions
diff --git a/Source/cmLocalVisualStudio6Generator.cxx b/Source/cmLocalVisualStudio6Generator.cxx
index 0c29c03..8592be7 100644
--- a/Source/cmLocalVisualStudio6Generator.cxx
+++ b/Source/cmLocalVisualStudio6Generator.cxx
@@ -1076,6 +1076,10 @@ void cmLocalVisualStudio6Generator
// Get extra linker options for this target type.
std::string extraLinkOptions;
+ std::string extraLinkOptionsDebug;
+ std::string extraLinkOptionsRelease;
+ std::string extraLinkOptionsMinSizeRel;
+ std::string extraLinkOptionsRelWithDebInfo;
if(target.GetType() == cmTarget::EXECUTABLE)
{
extraLinkOptions =
@@ -1099,6 +1103,33 @@ void cmLocalVisualStudio6Generator
extraLinkOptions += targetLinkFlags;
}
+ if(const char* targetLinkFlags = target.GetProperty("LINK_FLAGS_DEBUG"))
+ {
+ extraLinkOptionsDebug += " ";
+ extraLinkOptionsDebug += targetLinkFlags;
+ }
+
+ if(const char* targetLinkFlags = target.GetProperty("LINK_FLAGS_RELEASE"))
+ {
+ extraLinkOptionsRelease += " ";
+ extraLinkOptionsRelease += targetLinkFlags;
+ }
+
+ if(const char* targetLinkFlags = target.GetProperty("LINK_FLAGS_MINSIZEREL"))
+ {
+ extraLinkOptionsMinSizeRel += " ";
+ extraLinkOptionsMinSizeRel += targetLinkFlags;
+ }
+
+ if(const char* targetLinkFlags = target.GetProperty("LINK_FLAGS_RELWITHDEBINFO"))
+ {
+ extraLinkOptionsRelWithDebInfo += " ";
+ extraLinkOptionsRelWithDebInfo += targetLinkFlags;
+ }
+
+
+
+
// Get standard libraries for this language.
if(target.GetType() >= cmTarget::EXECUTABLE &&
target.GetType() <= cmTarget::MODULE_LIBRARY)
@@ -1171,13 +1202,13 @@ void cmLocalVisualStudio6Generator
target.GetType() == cmTarget::SHARED_LIBRARY ||
target.GetType() == cmTarget::MODULE_LIBRARY)
{
- this->ComputeLinkOptions(target, "Debug", extraLinkOptions,
+ this->ComputeLinkOptions(target, "Debug", extraLinkOptionsDebug,
optionsDebug);
- this->ComputeLinkOptions(target, "Release", extraLinkOptions,
+ this->ComputeLinkOptions(target, "Release", extraLinkOptionsRelease,
optionsRelease);
- this->ComputeLinkOptions(target, "MinSizeRel", extraLinkOptions,
+ this->ComputeLinkOptions(target, "MinSizeRel", extraLinkOptionsMinSizeRel,
optionsMinSizeRel);
- this->ComputeLinkOptions(target, "RelWithDebInfo", extraLinkOptions,
+ this->ComputeLinkOptions(target, "RelWithDebInfo", extraLinkOptionsRelWithDebInfo,
optionsRelWithDebInfo);
}
@@ -1341,41 +1372,18 @@ void cmLocalVisualStudio6Generator
std::string flagVar = baseFlagVar + "_RELEASE";
flagsRelease = this->Makefile->GetSafeDefinition(flagVar.c_str());
flagsRelease += " -DCMAKE_INTDIR=\\\"Release\\\" ";
- if(const char* targetLinkFlags =
- target.GetProperty("LINK_FLAGS_RELEASE"))
- {
- flagsRelease += targetLinkFlags;
- flagsRelease += " ";
- }
+
flagVar = baseFlagVar + "_MINSIZEREL";
flagsMinSize = this->Makefile->GetSafeDefinition(flagVar.c_str());
flagsMinSize += " -DCMAKE_INTDIR=\\\"MinSizeRel\\\" ";
- if(const char* targetLinkFlags =
- target.GetProperty("LINK_FLAGS_MINSIZEREL"))
- {
- flagsMinSize += targetLinkFlags;
- flagsMinSize += " ";
- }
-
+
flagVar = baseFlagVar + "_DEBUG";
flagsDebug = this->Makefile->GetSafeDefinition(flagVar.c_str());
flagsDebug += " -DCMAKE_INTDIR=\\\"Debug\\\" ";
- if(const char* targetLinkFlags = target.GetProperty("LINK_FLAGS_DEBUG"))
- {
- flagsDebug += targetLinkFlags;
- flagsDebug += " ";
- }
flagVar = baseFlagVar + "_RELWITHDEBINFO";
flagsDebugRel = this->Makefile->GetSafeDefinition(flagVar.c_str());
flagsDebugRel += " -DCMAKE_INTDIR=\\\"RelWithDebInfo\\\" ";
- if(const char* targetLinkFlags =
- target.GetProperty("LINK_FLAGS_RELWITHDEBINFO"))
- {
- flagsDebugRel += targetLinkFlags;
- flagsDebugRel += " ";
- }
-
}
// if unicode is not found, then add -D_MBCS