diff options
author | Brad King <brad.king@kitware.com> | 2010-05-28 14:20:10 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2010-05-28 14:22:19 (GMT) |
commit | 7458d465dde88a5e85b51d32b7b37f9dcfb9d216 (patch) | |
tree | 6464decb031fc45863a83cc13ce7fc01bcb388a3 /Source | |
parent | 282a119e355f86e20cc04fabd98083de2799c0ea (diff) | |
download | CMake-7458d465dde88a5e85b51d32b7b37f9dcfb9d216.zip CMake-7458d465dde88a5e85b51d32b7b37f9dcfb9d216.tar.gz CMake-7458d465dde88a5e85b51d32b7b37f9dcfb9d216.tar.bz2 |
Fix LINK_FLAGS_<CONFIG> in VS 6 generator
Add the flags to the link step, not the compile step!
Diffstat (limited to 'Source')
-rw-r--r-- | Source/cmLocalVisualStudio6Generator.cxx | 74 |
1 files changed, 45 insertions, 29 deletions
diff --git a/Source/cmLocalVisualStudio6Generator.cxx b/Source/cmLocalVisualStudio6Generator.cxx index 89bfd05..d7ffcf7 100644 --- a/Source/cmLocalVisualStudio6Generator.cxx +++ b/Source/cmLocalVisualStudio6Generator.cxx @@ -1142,6 +1142,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 = @@ -1165,6 +1169,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(targetBuilds) { @@ -1259,13 +1290,21 @@ void cmLocalVisualStudio6Generator target.GetType() == cmTarget::SHARED_LIBRARY || target.GetType() == cmTarget::MODULE_LIBRARY) { - this->ComputeLinkOptions(target, "Debug", extraLinkOptions, + extraLinkOptionsDebug = + extraLinkOptions + " " + extraLinkOptionsDebug; + extraLinkOptionsRelease = + extraLinkOptions + " " + extraLinkOptionsRelease; + extraLinkOptionsMinSizeRel = + extraLinkOptions + " " + extraLinkOptionsMinSizeRel; + extraLinkOptionsRelWithDebInfo = + extraLinkOptions + " " + extraLinkOptionsRelWithDebInfo; + 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); } @@ -1519,41 +1558,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 |