summaryrefslogtreecommitdiffstats
path: root/Source/cmMakefileTargetGenerator.cxx
diff options
context:
space:
mode:
authorBill Hoffman <bill.hoffman@kitware.com>2006-03-14 19:03:16 (GMT)
committerBill Hoffman <bill.hoffman@kitware.com>2006-03-14 19:03:16 (GMT)
commit88bd3b5281a146e1d1a31af4ab768a427341aedf (patch)
tree31bcd668e2890fabf59cfdd5c2e4f53bc2c82f7b /Source/cmMakefileTargetGenerator.cxx
parent8e702ac5a800fcd4fce0984b7a0e439b77d68ae9 (diff)
downloadCMake-88bd3b5281a146e1d1a31af4ab768a427341aedf.zip
CMake-88bd3b5281a146e1d1a31af4ab768a427341aedf.tar.gz
CMake-88bd3b5281a146e1d1a31af4ab768a427341aedf.tar.bz2
ENH: add support for removing language flags from shared library and shared module link commands
Diffstat (limited to 'Source/cmMakefileTargetGenerator.cxx')
-rw-r--r--Source/cmMakefileTargetGenerator.cxx22
1 files changed, 22 insertions, 0 deletions
diff --git a/Source/cmMakefileTargetGenerator.cxx b/Source/cmMakefileTargetGenerator.cxx
index 3ec828b..842c6eb 100644
--- a/Source/cmMakefileTargetGenerator.cxx
+++ b/Source/cmMakefileTargetGenerator.cxx
@@ -799,3 +799,25 @@ void cmMakefileTargetGenerator
delete this->InfoFileStream;
delete this->FlagFileStream;
}
+
+void cmMakefileTargetGenerator::RemoveForbiddenFlags(const char* flagVar,
+ const char* linkLang,
+ std::string& linkFlags)
+{
+ // check for language flags that are not allowed at link time, and
+ // remove them, -w on darwin for gcc -w -dynamiclib sends -w to libtool
+ // which fails, there may be more]
+
+ std::string removeFlags = "CMAKE_";
+ removeFlags += linkLang;
+ removeFlags += flagVar;
+ std::string removeflags =
+ this->Makefile->GetSafeDefinition(removeFlags.c_str());
+ std::vector<std::string> removeList;
+ cmSystemTools::ExpandListArgument(removeflags, removeList);
+ for(std::vector<std::string>::iterator i = removeList.begin();
+ i != removeList.end(); ++i)
+ {
+ cmSystemTools::ReplaceString(linkFlags, i->c_str(), "");
+ }
+}