summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2016-10-09 08:58:33 (GMT)
committerStephen Kelly <steveire@gmail.com>2016-10-09 08:58:33 (GMT)
commitd0faa58a51114a97f3af6a951b6c4052ca19c9ee (patch)
treef5c49fc88b7324ce0345b96a32478fbaf9c6bf47 /Source
parent785bfae867de0ad18463d618d45b4ae8c2712934 (diff)
downloadCMake-d0faa58a51114a97f3af6a951b6c4052ca19c9ee.zip
CMake-d0faa58a51114a97f3af6a951b6c4052ca19c9ee.tar.gz
CMake-d0faa58a51114a97f3af6a951b6c4052ca19c9ee.tar.bz2
Makefiles: Remove forbidden flag logic
This might have been needed some day in the past, but not anymore.
Diffstat (limited to 'Source')
-rw-r--r--Source/cmMakefileLibraryTargetGenerator.cxx17
-rw-r--r--Source/cmMakefileTargetGenerator.cxx46
-rw-r--r--Source/cmMakefileTargetGenerator.h2
3 files changed, 0 insertions, 65 deletions
diff --git a/Source/cmMakefileLibraryTargetGenerator.cxx b/Source/cmMakefileLibraryTargetGenerator.cxx
index 8e25f43..5db5c24 100644
--- a/Source/cmMakefileLibraryTargetGenerator.cxx
+++ b/Source/cmMakefileLibraryTargetGenerator.cxx
@@ -352,18 +352,6 @@ void cmMakefileLibraryTargetGenerator::WriteLibraryRules(
commands, buildEcho, cmLocalUnixMakefileGenerator3::EchoLink, &progress);
}
- const char* forbiddenFlagVar = CM_NULLPTR;
- switch (this->GeneratorTarget->GetType()) {
- case cmState::SHARED_LIBRARY:
- forbiddenFlagVar = "_CREATE_SHARED_LIBRARY_FORBIDDEN_FLAGS";
- break;
- case cmState::MODULE_LIBRARY:
- forbiddenFlagVar = "_CREATE_SHARED_MODULE_FORBIDDEN_FLAGS";
- break;
- default:
- break;
- }
-
// Clean files associated with this library.
std::vector<std::string> libCleanFiles;
libCleanFiles.push_back(this->LocalGenerator->MaybeConvertToRelativePath(
@@ -585,11 +573,6 @@ void cmMakefileLibraryTargetGenerator::WriteLibraryRules(
this->LocalGenerator->AddArchitectureFlags(
langFlags, this->GeneratorTarget, linkLanguage, this->ConfigName);
- // remove any language flags that might not work with the
- // particular os
- if (forbiddenFlagVar) {
- this->RemoveForbiddenFlags(forbiddenFlagVar, linkLanguage, langFlags);
- }
vars.LanguageCompileFlags = langFlags.c_str();
// Construct the main link rule and expand placeholders.
diff --git a/Source/cmMakefileTargetGenerator.cxx b/Source/cmMakefileTargetGenerator.cxx
index 14102ef..d256a69 100644
--- a/Source/cmMakefileTargetGenerator.cxx
+++ b/Source/cmMakefileTargetGenerator.cxx
@@ -1416,52 +1416,6 @@ void cmMakefileTargetGenerator::CloseFileStreams()
delete this->FlagFileStream;
}
-void cmMakefileTargetGenerator::RemoveForbiddenFlags(
- const char* flagVar, const std::string& 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);
- std::vector<std::string> removeList;
- cmSystemTools::ExpandListArgument(removeflags, removeList);
-
- for (std::vector<std::string>::iterator i = removeList.begin();
- i != removeList.end(); ++i) {
- std::string tmp;
- std::string::size_type lastPosition = 0;
-
- for (;;) {
- std::string::size_type position = linkFlags.find(*i, lastPosition);
-
- if (position == std::string::npos) {
- tmp += linkFlags.substr(lastPosition);
- break;
- } else {
- std::string::size_type prefixLength = position - lastPosition;
- tmp += linkFlags.substr(lastPosition, prefixLength);
- lastPosition = position + i->length();
-
- bool validFlagStart =
- position == 0 || isspace(linkFlags[position - 1]);
-
- bool validFlagEnd =
- lastPosition == linkFlags.size() || isspace(linkFlags[lastPosition]);
-
- if (!validFlagStart || !validFlagEnd) {
- tmp += *i;
- }
- }
- }
-
- linkFlags = tmp;
- }
-}
-
void cmMakefileTargetGenerator::CreateLinkScript(
const char* name, std::vector<std::string> const& link_commands,
std::vector<std::string>& makefile_commands,
diff --git a/Source/cmMakefileTargetGenerator.h b/Source/cmMakefileTargetGenerator.h
index df7b6aa..222161a 100644
--- a/Source/cmMakefileTargetGenerator.h
+++ b/Source/cmMakefileTargetGenerator.h
@@ -168,8 +168,6 @@ protected:
const std::string& lang) CM_OVERRIDE;
virtual void CloseFileStreams();
- void RemoveForbiddenFlags(const char* flagVar, const std::string& linkLang,
- std::string& linkFlags);
cmLocalUnixMakefileGenerator3* LocalGenerator;
cmGlobalUnixMakefileGenerator3* GlobalGenerator;