Commit 2be36b0a authored by Brad King's avatar Brad King Committed by Kitware Robot
Browse files

Merge topic 'remove-obsolete'

b6a174d2 Makefiles: Remove query for CMAKE_OBJECT_NAME
d0faa58a Makefiles: Remove forbidden flag logic
parents 9d0e5569 b6a174d2
......@@ -105,8 +105,6 @@ if("${_CURRENT_OSX_VERSION}" VERSION_LESS "10.5")
set(CMAKE_LINK_DEPENDENT_LIBRARY_FILES 1)
endif()
set(CMAKE_C_CREATE_SHARED_LIBRARY_FORBIDDEN_FLAGS -w)
set(CMAKE_CXX_CREATE_SHARED_LIBRARY_FORBIDDEN_FLAGS -w)
set(CMAKE_C_CREATE_SHARED_LIBRARY
"<CMAKE_C_COMPILER> <LANGUAGE_COMPILE_FLAGS> <CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS> <LINK_FLAGS> -o <TARGET> <SONAME_FLAG> <TARGET_INSTALLNAME_DIR><TARGET_SONAME> <OBJECTS> <LINK_LIBRARIES>")
set(CMAKE_CXX_CREATE_SHARED_LIBRARY
......
......@@ -365,18 +365,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(
......@@ -607,11 +595,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.
......
......@@ -1208,9 +1208,7 @@ void cmMakefileTargetGenerator::WriteObjectsVariable(
i != this->ExternalObjects.end(); ++i) {
object =
this->LocalGenerator->MaybeConvertToRelativePath(currentBinDir, *i);
*this->BuildFileStream << " " << lineContinue << "\n"
<< this->Makefile->GetSafeDefinition(
"CMAKE_OBJECT_NAME");
*this->BuildFileStream << " " << lineContinue << "\n";
*this->BuildFileStream << this->LocalGenerator->ConvertToQuotedOutputPath(
i->c_str(), useWatcomQuote);
}
......@@ -1422,52 +1420,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,
......
......@@ -171,8 +171,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;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment