Merge topic 'sun-better-stdlib'

3660d063 cmTarget: Use insert instead of std::copy.
5c28495f Help: Remove documented restriction on template use.
ac3d3829 Help: Remove documented restriction on find in conditions.
36b8de56 Help: Remove documented restriction on insert APIs.
6162c919 Use two-iterator std::set::insert where appropriate.
238dd2fb Use insert instead of a loop in some cases.
2f7ef7e3 Revert "Misc. fixes for the Oracle / Sun compiler."
4c69ec6f SolarisStudio: Use alternative standard library to build CMake.
This commit is contained in:
Brad King 2015-01-12 08:57:37 -05:00 committed by CMake Topic Stage
commit 6c61ffaf9b
40 changed files with 137 additions and 433 deletions

View File

@ -75,6 +75,14 @@ if(CMAKE_SYSTEM_PROCESSOR MATCHES "^parisc")
endif()
endif()
if (CMAKE_CXX_COMPILER_ID STREQUAL SunPro)
if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.13)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++03")
else()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -library=stlport4")
endif()
endif()
# use the ansi CXX compile flag for building cmake
if (CMAKE_ANSI_CXXFLAGS)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CMAKE_ANSI_CXXFLAGS}")

View File

@ -21,32 +21,6 @@ CMake is required to build with ancient C++ compilers and standard library
implementations. Some common C++ constructs may not be used in CMake in order
to build with such toolchains.
std::set const iterators
------------------------
The ``find()`` member function of a ``const`` ``std::set`` instance may not be
used in a comparison with the iterator returned by ``end()``:
.. code-block:: c++
const std::set<std::string>& someSet = getSet();
if (someSet.find("needle") == someSet.end()) // Wrong
{
// ...
}
The return value of ``find()`` must be assigned to an intermediate
``const_iterator`` for comparison:
.. code-block:: c++
const std::set<std::string>& someSet;
const std::set<std::string>::const_iterator i = someSet.find("needle");
if (i != propSet.end()) // Ok
{
// ...
}
std::auto_ptr
-------------
@ -54,53 +28,6 @@ Some implementations have a ``std::auto_ptr`` which can not be used as a
return value from a function. ``std::auto_ptr`` may not be used. Use
``cmsys::auto_ptr`` instead.
std::vector::insert and std::set
--------------------------------
Use of ``std::vector::insert`` with an iterator whose ``element_type`` requires
conversion is not allowed:
.. code-block:: c++
std::set<const char*> theSet;
std::vector<std::string> theVector;
theVector.insert(theVector.end(), theSet.begin(), theSet.end()); // Wrong
A loop must be used instead:
.. code-block:: c++
std::set<const char*> theSet;
std::vector<std::string> theVector;
for(std::set<const char*>::iterator li = theSet.begin();
li != theSet.end(); ++li)
{
theVector.push_back(*li);
}
std::set::insert
----------------
Use of ``std::set::insert`` is not allowed with any source container:
.. code-block:: c++
std::set<cmTarget*> theSet;
theSet.insert(targets.begin(), targets.end()); // Wrong
A loop must be used instead:
.. code-block:: c++
ConstIterator it = targets.begin();
const ConstIterator end = targets.end();
for ( ; it != end; ++it)
{
theSet.insert(*it);
}
.. SunCC 5.9
Template Parameter Defaults
---------------------------
@ -137,12 +64,6 @@ assigning the result of ``.size()`` on a container for example, the result
should be assigned to ``size_t`` not to ``std::size_t``, ``unsigned int`` or
similar types.
Templates
---------
Some template code is permitted, but with some limitations. Member templates
may not be used, and template friends may not be used.
Adding Compile Features
=======================

View File

@ -1150,12 +1150,7 @@ void cmCPackWIXGenerator::CollectExtensions(
std::vector<std::string> list;
cmSystemTools::ExpandListArgument(variableContent, list);
for(std::vector<std::string>::const_iterator i = list.begin();
i != list.end(); ++i)
{
extensions.insert(*i);
}
extensions.insert(list.begin(), list.end());
}
void cmCPackWIXGenerator::AddCustomFlags(

View File

@ -1094,11 +1094,8 @@ void cmCTestBuildHandler::ProcessBuffer(const char* data, int length,
{
// Create a contiguous array for the line
this->CurrentProcessingLine.clear();
t_BuildProcessingQueueType::iterator cit;
for ( cit = queue->begin(); cit != it; ++cit )
{
this->CurrentProcessingLine.push_back(*cit);
}
this->CurrentProcessingLine.insert(this->CurrentProcessingLine.end(),
queue->begin(), queue->end());
this->CurrentProcessingLine.push_back(0);
const char* line = &*this->CurrentProcessingLine.begin();

View File

@ -2498,11 +2498,7 @@ void cmCTestCoverageHandler::LoadLabels(const char* dir)
// Label the source with the target labels.
LabelSet& labelSet = this->SourceLabels[source];
for(std::vector<int>::const_iterator li = targetLabels.begin();
li != targetLabels.end(); ++li)
{
labelSet.insert(*li);
}
labelSet.insert(targetLabels.begin(), targetLabels.end());
}
}
}

View File

@ -162,12 +162,9 @@ void cmCTestMultiProcessHandler::StartTestProcess(int test)
//---------------------------------------------------------
void cmCTestMultiProcessHandler::LockResources(int index)
{
for(std::set<std::string>::iterator i =
this->Properties[index]->LockedResources.begin();
i != this->Properties[index]->LockedResources.end(); ++i)
{
this->LockedResources.insert(*i);
}
this->LockedResources.insert(
this->Properties[index]->LockedResources.begin(),
this->Properties[index]->LockedResources.end());
}
//---------------------------------------------------------
@ -499,11 +496,7 @@ void cmCTestMultiProcessHandler::CreateParallelTestCostList()
i != previousSet.end(); ++i)
{
TestSet const& dependencies = this->Tests[*i];
for(TestSet::const_iterator j = dependencies.begin();
j != dependencies.end(); ++j)
{
currentSet.insert(*j);
}
currentSet.insert(dependencies.begin(), dependencies.end());
}
for(TestSet::const_iterator i = currentSet.begin();
@ -526,11 +519,8 @@ void cmCTestMultiProcessHandler::CreateParallelTestCostList()
TestList sortedCopy;
for(TestSet::const_iterator j = currentSet.begin();
j != currentSet.end(); ++j)
{
sortedCopy.push_back(*j);
}
sortedCopy.insert(sortedCopy.end(),
currentSet.begin(), currentSet.end());
std::stable_sort(sortedCopy.begin(), sortedCopy.end(), comp);

View File

@ -349,11 +349,7 @@ void cmCTestP4::SetP4Options(std::vector<char const*> &CommandOptions)
std::vector<std::string> args =
cmSystemTools::ParseArguments(opts.c_str());
for(std::vector<std::string>::const_iterator ai = args.begin();
ai != args.end(); ++ai)
{
P4Options.push_back(*ai);
}
P4Options.insert(P4Options.end(), args.begin(), args.end());
}
CommandOptions.clear();

View File

@ -74,13 +74,8 @@ cmCTestGenericHandler* cmCTestSubmitCommand::InitializeHandler()
std::vector<std::string> notesFiles;
cmCTest::VectorOfStrings newNotesFiles;
cmSystemTools::ExpandListArgument(notesFilesVariable,notesFiles);
std::vector<std::string>::iterator it;
for ( it = notesFiles.begin();
it != notesFiles.end();
++ it )
{
newNotesFiles.push_back(*it);
}
newNotesFiles.insert(newNotesFiles.end(),
notesFiles.begin(), notesFiles.end());
this->CTest->GenerateNotesFile(newNotesFiles);
}
@ -91,13 +86,8 @@ cmCTestGenericHandler* cmCTestSubmitCommand::InitializeHandler()
std::vector<std::string> extraFiles;
cmCTest::VectorOfStrings newExtraFiles;
cmSystemTools::ExpandListArgument(extraFilesVariable,extraFiles);
std::vector<std::string>::iterator it;
for ( it = extraFiles.begin();
it != extraFiles.end();
++ it )
{
newExtraFiles.push_back(*it);
}
newExtraFiles.insert(newExtraFiles.end(),
extraFiles.begin(), extraFiles.end());
if ( !this->CTest->SubmitExtraFiles(newExtraFiles))
{
this->SetError("problem submitting extra files.");

View File

@ -1160,11 +1160,7 @@ int cmCTestSubmitHandler::ProcessHandler()
{
// Submit the explicitly selected files:
//
cmCTest::SetOfStrings::const_iterator it;
for (it = this->Files.begin(); it != this->Files.end(); ++it)
{
files.insert(*it);
}
files.insert(this->Files.begin(), this->Files.end());
}
// Add to the list of files to submit from any selected, existing parts:
@ -1219,11 +1215,7 @@ int cmCTestSubmitHandler::ProcessHandler()
// Submit files from this part.
std::vector<std::string> const& pfiles = this->CTest->GetSubmitFiles(p);
for(std::vector<std::string>::const_iterator pi = pfiles.begin();
pi != pfiles.end(); ++pi)
{
files.insert(*pi);
}
files.insert(pfiles.begin(), pfiles.end());
}
if ( ofs )
@ -1503,9 +1495,5 @@ void cmCTestSubmitHandler::SelectParts(std::set<cmCTest::Part> const& parts)
//----------------------------------------------------------------------------
void cmCTestSubmitHandler::SelectFiles(cmCTest::SetOfStrings const& files)
{
cmCTest::SetOfStrings::const_iterator it;
for (it = files.begin(); it != files.end(); ++it)
{
this->Files.insert(*it);
}
this->Files.insert(files.begin(), files.end());
}

View File

@ -2163,11 +2163,7 @@ bool cmCTestTestHandler::SetTestsProperties(
std::vector<std::string> lval;
cmSystemTools::ExpandListArgument(val, lval);
for(std::vector<std::string>::iterator f = lval.begin();
f != lval.end(); ++f)
{
rtit->LockedResources.insert(*f);
}
rtit->LockedResources.insert(lval.begin(), lval.end());
}
if ( key == "TIMEOUT" )
{

View File

@ -36,11 +36,7 @@ bool cmAddTestCommand
// Collect the command with arguments.
std::vector<std::string> command;
for(std::vector<std::string>::const_iterator it = args.begin() + 1;
it != args.end(); ++it)
{
command.push_back(*it);
}
command.insert(command.end(), args.begin() + 1, args.end());
// Create the test but add a generator only the first time it is
// seen. This preserves behavior from before test generators.

View File

@ -50,13 +50,8 @@ void cmCommandArgument::FollowsGroup(const cmCommandArgumentGroup* group)
if (group!=0)
{
this->ArgumentsBeforeEmpty = false;
for(std::vector<cmCommandArgument*>::const_iterator
argIt= group->ContainedArguments.begin();
argIt != group->ContainedArguments.end();
++argIt)
{
this->ArgumentsBefore.insert(*argIt);
}
this->ArgumentsBefore.insert(group->ContainedArguments.begin(),
group->ContainedArguments.end());
}
}

View File

@ -266,10 +266,9 @@ cmComputeLinkDepends::Compute()
// Iterate in reverse order so we can keep only the last occurrence
// of a shared library.
std::set<int> emmitted;
const std::vector<int>& cFLO = this->FinalLinkOrder;
for(std::vector<int>::const_reverse_iterator
li = cFLO.rbegin(),
le = cFLO.rend();
li = this->FinalLinkOrder.rbegin(),
le = this->FinalLinkOrder.rend();
li != le; ++li)
{
int i = *li;

View File

@ -408,11 +408,7 @@ cmComputeLinkInformation
// Construct a mask to not bother with this behavior for link
// directories already specified by the user.
std::vector<std::string> const& dirs = this->Target->GetLinkDirectories();
for(std::vector<std::string>::const_iterator di = dirs.begin();
di != dirs.end(); ++di)
{
this->OldLinkDirMask.insert(*di);
}
this->OldLinkDirMask.insert(dirs.begin(), dirs.end());
}
}
@ -1420,11 +1416,8 @@ void cmComputeLinkInformation::ComputeFrameworkInfo()
cmSystemTools::ExpandListArgument(implicitDirs, implicitDirVec);
}
for(std::vector<std::string>::const_iterator i = implicitDirVec.begin();
i != implicitDirVec.end(); ++i)
{
this->FrameworkPathsEmmitted.insert(*i);
}
this->FrameworkPathsEmmitted.insert(implicitDirVec.begin(),
implicitDirVec.end());
// Regular expression to extract a framework path and name.
this->SplitFramework.compile("(.*)/(.*)\\.framework$");
@ -1694,11 +1687,7 @@ void cmComputeLinkInformation::LoadImplicitLinkInfo()
}
// Store implicit link directories.
for(std::vector<std::string>::const_iterator i = implicitDirVec.begin();
i != implicitDirVec.end(); ++i)
{
this->ImplicitLinkDirs.insert(*i);
}
this->ImplicitLinkDirs.insert(implicitDirVec.begin(), implicitDirVec.end());
// Get language-specific implicit libraries.
std::vector<std::string> implicitLibVec;

View File

@ -53,10 +53,7 @@ bool cmConditionEvaluator::IsTrue(
cmArgumentList newArgs;
// copy to the list structure
for(unsigned int i = 0; i < args.size(); ++i)
{
newArgs.push_back(args[i]);
}
newArgs.insert(newArgs.end(), args.begin(), args.end());
// now loop through the arguments and see if we can reduce any of them
// we do this multiple times. Once for each level of precedence
@ -411,10 +408,7 @@ bool cmConditionEvaluator::HandleLevel0(cmArgumentList &newArgs,
// copy to the list structure
cmArgumentList::iterator argP1 = arg;
argP1++;
for(; argP1 != argClose; argP1++)
{
newArgs2.push_back(*argP1);
}
newArgs2.insert(newArgs2.end(), argP1, argClose);
newArgs2.pop_back();
// now recursively invoke IsTrue to handle the values inside the
// parenthetical expression

View File

@ -131,21 +131,14 @@ const char* cmCustomCommand::GetComment() const
//----------------------------------------------------------------------------
void cmCustomCommand::AppendCommands(const cmCustomCommandLines& commandLines)
{
for(cmCustomCommandLines::const_iterator i=commandLines.begin();
i != commandLines.end(); ++i)
{
this->CommandLines.push_back(*i);
}
this->CommandLines.insert(this->CommandLines.end(),
commandLines.begin(), commandLines.end());
}
//----------------------------------------------------------------------------
void cmCustomCommand::AppendDepends(const std::vector<std::string>& depends)
{
for(std::vector<std::string>::const_iterator i=depends.begin();
i != depends.end(); ++i)
{
this->Depends.push_back(*i);
}
this->Depends.insert(this->Depends.end(), depends.begin(), depends.end());
}
//----------------------------------------------------------------------------

View File

@ -125,11 +125,7 @@ bool cmDependsC::WriteDependencies(const std::set<std::string>& sources,
this->ValidDeps->find(obj);
if (tmpIt!= this->ValidDeps->end())
{
for(DependencyVector::const_iterator i=tmpIt->second.begin();
i != tmpIt->second.end(); ++i)
{
dependencies.insert(*i);
}
dependencies.insert(tmpIt->second.begin(), tmpIt->second.end());
haveDeps = true;
}
}

View File

@ -319,17 +319,13 @@ void cmDependsFortran::LocateModules()
infoI != objInfo.end(); ++infoI)
{
cmDependsFortranSourceInfo const& info = infoI->second;
for(std::set<std::string>::const_iterator i = info.Provides.begin();
i != info.Provides.end(); ++i)
{
// Include this module in the set provided by this target.
this->Internal->TargetProvides.insert(*i);
}
// Include this module in the set provided by this target.
this->Internal->TargetProvides.insert(info.Provides.begin(),
info.Provides.end());
for(std::set<std::string>::const_iterator i = info.Requires.begin();
i != info.Requires.end(); ++i)
{
// Include this module in the set required by this target.
this->Internal->TargetRequires[*i] = "";
}
}

View File

@ -456,11 +456,7 @@ void getPropertyContents(cmTarget const* tgt, const std::string& prop,
}
std::vector<std::string> content;
cmSystemTools::ExpandListArgument(p, content);
for (std::vector<std::string>::const_iterator ci = content.begin();
ci != content.end(); ++ci)
{
ifaceProperties.insert(*ci);
}
ifaceProperties.insert(content.begin(), content.end());
}
//----------------------------------------------------------------------------

View File

@ -615,12 +615,8 @@ void cmExtraCodeBlocksGenerator::AppendTarget(cmGeneratedFileStream& fout,
std::vector<std::string> includes;
target->GetMakefile()->GetLocalGenerator()->
GetIncludeDirectories(includes, gtgt, "C", buildType);
for(std::vector<std::string>::const_iterator dirIt=includes.begin();
dirIt != includes.end();
++dirIt)
{
uniqIncludeDirs.insert(*dirIt);
}
uniqIncludeDirs.insert(includes.begin(), includes.end());
std::string systemIncludeDirs = makefile->GetSafeDefinition(
"CMAKE_EXTRA_GENERATOR_C_SYSTEM_INCLUDE_DIRS");
@ -628,12 +624,7 @@ void cmExtraCodeBlocksGenerator::AppendTarget(cmGeneratedFileStream& fout,
{
std::vector<std::string> dirs;
cmSystemTools::ExpandListArgument(systemIncludeDirs, dirs);
for(std::vector<std::string>::const_iterator dirIt=dirs.begin();
dirIt != dirs.end();
++dirIt)
{
uniqIncludeDirs.insert(*dirIt);
}
uniqIncludeDirs.insert(dirs.begin(), dirs.end());
}
systemIncludeDirs = makefile->GetSafeDefinition(
@ -642,12 +633,7 @@ void cmExtraCodeBlocksGenerator::AppendTarget(cmGeneratedFileStream& fout,
{
std::vector<std::string> dirs;
cmSystemTools::ExpandListArgument(systemIncludeDirs, dirs);
for(std::vector<std::string>::const_iterator dirIt=dirs.begin();
dirIt != dirs.end();
++dirIt)
{
uniqIncludeDirs.insert(*dirIt);
}
uniqIncludeDirs.insert(dirs.begin(), dirs.end());
}
for(std::set<std::string>::const_iterator dirIt=uniqIncludeDirs.begin();

View File

@ -184,10 +184,8 @@ bool cmFindBase::ParseArguments(std::vector<std::string> const& argsIn)
std::vector<std::string> shortArgs = this->Names;
this->Names.clear(); // clear out any values in Names
this->Names.push_back(shortArgs[0]);
for(unsigned int j = 1; j < shortArgs.size(); ++j)
{
this->UserGuessArgs.push_back(shortArgs[j]);
}
this->UserGuessArgs.insert(this->UserGuessArgs.end(),
shortArgs.begin() + 1, shortArgs.end());
}
this->ExpandPaths();

View File

@ -80,15 +80,12 @@ void cmFindPackageCommand::AppendSearchPathGroups()
PathLabel::SystemRegistry);
// Create the new path objects
this->LabeledPaths.insert(
std::pair<cmFindCommon::PathLabel, cmSearchPath>(
PathLabel::UserRegistry, cmSearchPath(this)));
this->LabeledPaths.insert(
std::pair<cmFindCommon::PathLabel, cmSearchPath>(
PathLabel::Builds, cmSearchPath(this)));
this->LabeledPaths.insert(
std::pair<cmFindCommon::PathLabel, cmSearchPath>(
PathLabel::SystemRegistry, cmSearchPath(this)));
this->LabeledPaths.insert(std::make_pair(PathLabel::UserRegistry,
cmSearchPath(this)));
this->LabeledPaths.insert(std::make_pair(PathLabel::Builds,
cmSearchPath(this)));
this->LabeledPaths.insert(std::make_pair(PathLabel::SystemRegistry,
cmSearchPath(this)));
}
//----------------------------------------------------------------------------

View File

@ -271,11 +271,7 @@ bool cmFunctionCommand
// create a function blocker
cmFunctionFunctionBlocker *f = new cmFunctionFunctionBlocker();
for(std::vector<std::string>::const_iterator j = args.begin();
j != args.end(); ++j)
{
f->Args.push_back(*j);
}
f->Args.insert(f->Args.end(), args.begin(), args.end());
this->Makefile->AddFunctionBlocker(f);
return true;
}

View File

@ -66,9 +66,7 @@ cmGeneratorExpressionDAGChecker::Initialize()
if (it != top->Seen.end())
{
const std::set<std::string> &propSet = it->second;
const std::set<std::string>::const_iterator i
= propSet.find(this->Property);
if (i != propSet.end())
if (propSet.find(this->Property) != propSet.end())
{
this->CheckResult = ALREADY_SEEN;
return;

View File

@ -489,11 +489,7 @@ bool cmGeneratorTarget::IsSystemIncludeDirectory(const std::string& dir,
unique.insert(*li);
}
result.clear();
for(std::set<std::string>::iterator li = unique.begin();
li != unique.end(); ++li)
{
result.push_back(*li);
}
result.insert(result.end(), unique.begin(), unique.end());
IncludeCacheType::value_type entry(config_upper, result);
iter = this->SystemIncludesCache.insert(entry).first;
@ -822,11 +818,7 @@ cmTargetTraceDependencies
= ge.Parse(*cli);
cge->Evaluate(this->Makefile, "", true);
std::set<cmTarget*> geTargets = cge->GetTargets();
for(std::set<cmTarget*>::const_iterator it = geTargets.begin();
it != geTargets.end(); ++it)
{
targets.insert(*it);
}
targets.insert(geTargets.begin(), geTargets.end());
}
}

View File

@ -1021,12 +1021,9 @@ void cmGlobalNinjaGenerator::WriteUnknownExplicitDependencies(std::ostream& os)
}
//insert outputs from all WirteBuild commands
for(std::set<std::string>::iterator i = this->CombinedBuildOutputs.begin();
i != this->CombinedBuildOutputs.end(); ++i)
{
//these paths have already be encoded when added to CombinedBuildOutputs
knownDependencies.insert(*i);
}
//these paths have already be encoded when added to CombinedBuildOutputs
knownDependencies.insert(this->CombinedBuildOutputs.begin(),
this->CombinedBuildOutputs.end());
//after we have combined the data into knownDependencies we have no need
//to keep this data around

View File

@ -845,22 +845,14 @@ cmGlobalVisualStudioGenerator::TargetCompare
cmGlobalVisualStudioGenerator::OrderedTargetDependSet
::OrderedTargetDependSet(TargetDependSet const& targets)
{
for(TargetDependSet::const_iterator ti =
targets.begin(); ti != targets.end(); ++ti)
{
this->insert(*ti);
}
this->insert(targets.begin(), targets.end());
}
//----------------------------------------------------------------------------
cmGlobalVisualStudioGenerator::OrderedTargetDependSet
::OrderedTargetDependSet(TargetSet const& targets)
{
for(TargetSet::const_iterator ti = targets.begin();
ti != targets.end(); ++ti)
{
this->insert(*ti);
}
this->insert(targets.begin(), targets.end());
}
std::string cmGlobalVisualStudioGenerator::ExpandCFGIntDir(

View File

@ -71,11 +71,7 @@ bool cmIncludeDirectoryCommand
}
if (system)
{
for (std::vector<std::string>::const_iterator li = includes.begin();
li != includes.end(); ++li)
{
systemIncludes.insert(*li);
}
systemIncludes.insert(includes.begin(), includes.end());
}
}
std::reverse(beforeIncludes.begin(), beforeIncludes.end());

View File

@ -47,11 +47,8 @@ bool cmInstallFilesCommand
else
{
this->IsFilesForm = false;
std::vector<std::string>::const_iterator s = args.begin();
for (++s;s != args.end(); ++s)
{
this->FinalArgs.push_back(*s);
}
this->FinalArgs.insert(this->FinalArgs.end(),
args.begin() + 1, args.end());
}
this->Makefile->GetLocalGenerator()->GetGlobalGenerator()

View File

@ -27,11 +27,7 @@ bool cmInstallProgramsCommand
this->Destination = args[0];
std::vector<std::string>::const_iterator s = args.begin();
for (++s;s != args.end(); ++s)
{
this->FinalArgs.push_back(*s);
}
this->FinalArgs.insert(this->FinalArgs.end(), args.begin() + 1, args.end());
this->Makefile->GetLocalGenerator()->GetGlobalGenerator()
->AddInstallComponent(this->Makefile->GetSafeDefinition(

View File

@ -634,11 +634,7 @@ void cmLocalGenerator::AddCustomCommandToCreateObject(const char* ofname,
// Parse the string to get the custom command line.
cmCustomCommandLine commandLine;
std::vector<std::string> cmd = cmSystemTools::ParseArguments(i->c_str());
for(std::vector<std::string>::iterator a = cmd.begin();
a != cmd.end(); ++a)
{
commandLine.push_back(*a);
}
commandLine.insert(commandLine.end(), cmd.begin(), cmd.end());
// Store this command line.
commandLines.push_back(commandLine);
@ -745,11 +741,7 @@ void cmLocalGenerator::AddBuildTargetRule(const std::string& llang,
// Parse the string to get the custom command line.
cmCustomCommandLine commandLine;
std::vector<std::string> cmd = cmSystemTools::ParseArguments(i->c_str());
for(std::vector<std::string>::iterator a = cmd.begin();
a != cmd.end(); ++a)
{
commandLine.push_back(*a);
}
commandLine.insert(commandLine.end(), cmd.begin(), cmd.end());
// Store this command line.
commandLines.push_back(commandLine);

View File

@ -1856,13 +1856,8 @@ void cmLocalUnixMakefileGenerator3
{
text = "Running external command ...";
}
std::set<std::string>::const_iterator dit;
for ( dit = glIt->second.GetUtilities().begin();
dit != glIt->second.GetUtilities().end();
++ dit )
{
depends.push_back(*dit);
}
depends.insert(depends.end(), glIt->second.GetUtilities().begin(),
glIt->second.GetUtilities().end());
this->AppendEcho(commands, text,
cmLocalUnixMakefileGenerator3::EchoGlobal);

View File

@ -328,11 +328,7 @@ bool cmMacroCommand::InitialPass(std::vector<std::string> const& args,
// create a function blocker
cmMacroFunctionBlocker *f = new cmMacroFunctionBlocker();
for(std::vector<std::string>::const_iterator j = args.begin();
j != args.end(); ++j)
{
f->Args.push_back(*j);
}
f->Args.insert(f->Args.end(), args.begin(), args.end());
this->Makefile->AddFunctionBlocker(f);
return true;
}

View File

@ -1822,11 +1822,7 @@ void cmMakefile::AddIncludeDirectories(const std::vector<std::string> &incs,
void
cmMakefile::AddSystemIncludeDirectories(const std::set<std::string> &incs)
{
for(std::set<std::string>::const_iterator li = incs.begin();
li != incs.end(); ++li)
{
this->SystemIncludeDirectories.insert(*li);
}
this->SystemIncludeDirectories.insert(incs.begin(), incs.end());
for (cmTargets::iterator l = this->Targets.begin();
l != this->Targets.end(); ++l)
@ -2567,12 +2563,7 @@ std::vector<std::string> cmMakefile
}
std::vector<std::string> res;
std::set<std::string>::iterator fit;
for ( fit = definitions.begin(); fit != definitions.end(); fit ++ )
{
res.push_back(*fit);
}
res.insert(res.end(), definitions.begin(), definitions.end());
return res;
}
@ -4561,16 +4552,8 @@ void cmMakefile::PopScope()
this->Internal->VarInitStack.pop();
this->Internal->VarUsageStack.pop();
// Push initialization and usage up to the parent scope.
it = init.begin();
for (; it != init.end(); ++it)
{
this->Internal->VarInitStack.top().insert(*it);
}
it = usage.begin();
for (; it != usage.end(); ++it)
{
this->Internal->VarUsageStack.top().insert(*it);
}
this->Internal->VarInitStack.top().insert(init.begin(), init.end());
this->Internal->VarUsageStack.top().insert(usage.begin(), usage.end());
}
void cmMakefile::RaiseScope(const std::string& var, const char *varDef)

View File

@ -759,13 +759,10 @@ cmMakefileTargetGenerator
if(const char* extra_outputs_str =
source.GetProperty("OBJECT_OUTPUTS"))
{
// Register these as extra files to clean.
cmSystemTools::ExpandListArgument(extra_outputs_str, outputs);
for(std::vector<std::string>::const_iterator eoi = outputs.begin()+1;
eoi != outputs.end(); ++eoi)
{
// Register this as an extra file to clean.
this->CleanFiles.push_back(*eoi);
}
this->CleanFiles.insert(this->CleanFiles.end(),
outputs.begin() + 1, outputs.end());
}
// Write the rule.
@ -1174,11 +1171,7 @@ cmMakefileTargetGenerator
{
cmCustomCommandGenerator ccg(*cc, this->ConfigName, this->Makefile);
const std::vector<std::string>& outputs = ccg.GetOutputs();
for(std::vector<std::string>::const_iterator o = outputs.begin();
o != outputs.end(); ++o)
{
depends.push_back(*o);
}
depends.insert(depends.end(), outputs.begin(), outputs.end());
}
}
}
@ -1462,11 +1455,8 @@ void cmMakefileTargetGenerator::WriteTargetDriverRule(
}
// Make sure the extra files are built.
for(std::set<std::string>::const_iterator i = this->ExtraFiles.begin();
i != this->ExtraFiles.end(); ++i)
{
depends.push_back(*i);
}
depends.insert(depends.end(),
this->ExtraFiles.begin(), this->ExtraFiles.end());
}
// Write the driver rule.
@ -1553,11 +1543,7 @@ void cmMakefileTargetGenerator
if(cmComputeLinkInformation* cli = this->Target->GetLinkInformation(cfg))
{
std::vector<std::string> const& libDeps = cli->GetDepends();
for(std::vector<std::string>::const_iterator j = libDeps.begin();
j != libDeps.end(); ++j)
{
depends.push_back(*j);
}
depends.insert(depends.end(), libDeps.begin(), libDeps.end());
}
}
@ -1577,12 +1563,8 @@ void cmMakefileTargetGenerator
}
// Add dependencies on the external object files.
for(std::vector<std::string>::const_iterator obj
= this->ExternalObjects.begin();
obj != this->ExternalObjects.end(); ++obj)
{
depends.push_back(*obj);
}
depends.insert(depends.end(),
this->ExternalObjects.begin(), this->ExternalObjects.end());
// Add a dependency on the rule file itself.
this->LocalGenerator->AppendRuleDepend(depends,

View File

@ -899,12 +899,7 @@ void cmQtAutoGenerators::SetupAutoUicTarget(cmTarget const* target,
std::set<std::string> skipped;
std::vector<std::string> skipVec;
cmSystemTools::ExpandListArgument(this->SkipUic, skipVec);
for (std::vector<std::string>::const_iterator li = skipVec.begin();
li != skipVec.end(); ++li)
{
skipped.insert(*li);
}
skipped.insert(skipVec.begin(), skipVec.end());
makefile->AddDefinition("_skip_uic",
cmLocalGenerator::EscapeForCMake(this->SkipUic).c_str());
@ -1622,12 +1617,7 @@ bool cmQtAutoGenerators::RunAutogen(cmMakefile* makefile)
std::vector<std::string> headerFilesVec;
cmSystemTools::ExpandListArgument(this->Headers, headerFilesVec);
for (std::vector<std::string>::const_iterator it = headerFilesVec.begin();
it != headerFilesVec.end();
++it)
{
headerFiles.insert(*it);
}
headerFiles.insert(headerFilesVec.begin(), headerFilesVec.end());
// key = moc source filepath, value = moc output filename
std::map<std::string, std::string> notIncludedMocs;
@ -2188,24 +2178,12 @@ bool cmQtAutoGenerators::GenerateMoc(const std::string& sourceFile,
std::vector<std::string> command;
command.push_back(this->MocExecutable);
for (std::list<std::string>::const_iterator it = this->MocIncludes.begin();
it != this->MocIncludes.end();
++it)
{
command.push_back(*it);
}
for(std::list<std::string>::const_iterator it=this->MocDefinitions.begin();
it != this->MocDefinitions.end();
++it)
{
command.push_back(*it);
}
for(std::vector<std::string>::const_iterator it=this->MocOptions.begin();
it != this->MocOptions.end();
++it)
{
command.push_back(*it);
}
command.insert(command.end(),
this->MocIncludes.begin(), this->MocIncludes.end());
command.insert(command.end(),
this->MocDefinitions.begin(), this->MocDefinitions.end());
command.insert(command.end(),
this->MocOptions.begin(), this->MocOptions.end());
#ifdef _WIN32
command.push_back("-DWIN32");
#endif
@ -2277,12 +2255,7 @@ bool cmQtAutoGenerators::GenerateUi(const std::string& realName,
cmSystemTools::ExpandListArgument(optionIt->second, fileOpts);
this->MergeUicOptions(opts, fileOpts, this->QtMajorVersion == "5");
}
for(std::vector<std::string>::const_iterator optIt = opts.begin();
optIt != opts.end();
++optIt)
{
command.push_back(*optIt);
}
command.insert(command.end(), opts.begin(), opts.end());
command.push_back("-o");
command.push_back(this->Builddir + ui_output_file);

View File

@ -39,10 +39,7 @@ bool cmRemoveCommand
// check for REMOVE(VAR v1 v2 ... vn)
std::vector<std::string> argsExpanded;
std::vector<std::string> temp;
for(unsigned int j = 1; j < args.size(); ++j)
{
temp.push_back(args[j]);
}
temp.insert(temp.end(), args.begin() + 1, args.end());
cmSystemTools::ExpandList(temp, argsExpanded);
// now create the new value

View File

@ -1273,11 +1273,7 @@ bool cmSystemTools::Split(const char* s, std::vector<std::string>& l)
{
std::vector<std::string> temp;
bool res = Superclass::Split(s, temp);
for(std::vector<std::string>::const_iterator i = temp.begin();
i != temp.end(); ++i)
{
l.push_back(*i);
}
l.insert(l.end(), temp.begin(), temp.end());
return res;
}

View File

@ -424,12 +424,8 @@ void cmTarget::SetMakefile(cmMakefile* mf)
const std::set<std::string> parentSystemIncludes =
this->Makefile->GetSystemIncludeDirectories();
for (std::set<std::string>::const_iterator it
= parentSystemIncludes.begin();
it != parentSystemIncludes.end(); ++it)
{
this->SystemIncludeDirectories.insert(*it);
}
this->SystemIncludeDirectories.insert(parentSystemIncludes.begin(),
parentSystemIncludes.end());
const std::vector<cmValueWithOrigin> parentOptions =
this->Makefile->GetCompileOptionsEntries();
@ -1397,22 +1393,14 @@ void cmTarget::AddLinkLibrary(cmMakefile& mf,
void
cmTarget::AddSystemIncludeDirectories(const std::set<std::string> &incs)
{
for(std::set<std::string>::const_iterator li = incs.begin();
li != incs.end(); ++li)
{
this->SystemIncludeDirectories.insert(*li);
}
this->SystemIncludeDirectories.insert(incs.begin(), incs.end());
}
//----------------------------------------------------------------------------
void
cmTarget::AddSystemIncludeDirectories(const std::vector<std::string> &incs)
{
for(std::vector<std::string>::const_iterator li = incs.begin();
li != incs.end(); ++li)
{
this->SystemIncludeDirectories.insert(*li);
}
this->SystemIncludeDirectories.insert(incs.begin(), incs.end());
}
#if defined(_WIN32) && !defined(__CYGWIN__)
@ -6070,8 +6058,8 @@ cmTargetInternals::ComputeLinkInterfaceLibraries(
// The link implementation is the default link interface.
cmTarget::LinkImplementationLibraries const* impl =
thisTarget->GetLinkImplementationLibrariesInternal(config, headTarget);
std::copy(impl->Libraries.begin(), impl->Libraries.end(),
std::back_inserter(iface.Libraries));
iface.Libraries.insert(iface.Libraries.end(),
impl->Libraries.begin(), impl->Libraries.end());
if(thisTarget->PolicyStatusCMP0022 == cmPolicies::WARN &&
!this->PolicyWarnedCMP0022 && !usage_requirements_only)
{
@ -6449,11 +6437,8 @@ cmTargetInternals::ComputeLinkImplementationLanguages(
// Get languages used in our source files.
thisTarget->GetLanguages(languages, config);
// Copy the set of langauges to the link implementation.
for(std::set<std::string>::iterator li = languages.begin();
li != languages.end(); ++li)
{
impl.Languages.push_back(*li);
}
impl.Languages.insert(impl.Languages.begin(),
languages.begin(), languages.end());
}
//----------------------------------------------------------------------------

View File

@ -1154,6 +1154,35 @@ if [ "x${cmake_cxx_compiler_is_gnu}" != "x1" ]; then
cmake_test_flags=
fi
if [ "x${cmake_cxx_compiler_is_gnu}" != "x1" ]; then
# Are we SolarisStudio?
TMPFILE=`cmake_tmp_file`
echo '
#if defined(__SUNPRO_CC)
#include <iostream>
int main() { std::cout << "This is SolarisStudio" << std::endl; return 0;}
#endif
' > ${TMPFILE}.cxx
cmake_cxx_compiler_is_solarisstudio=0
if cmake_try_run "${cmake_cxx_compiler}" \
"${cmake_cxx_flags} " "${TMPFILE}.cxx" >> cmake_bootstrap.log 2>&1; then
cmake_cxx_compiler_is_solarisstudio=1
fi
if [ "x${cmake_cxx_compiler_is_solarisstudio}" = "x1" ]; then
echo "${cmake_cxx_compiler} is SolarisStudio compiler"
else
echo "${cmake_cxx_compiler} is not SolarisStudio compiler"
fi
rm -f "${TMPFILE}.cxx"
if [ "x${cmake_cxx_compiler_is_solarisstudio}" = "x1" ]; then
cmake_cxx_flags="${cmake_cxx_flags} -library=stlport4"
fi
fi
# Test for kwsys features
KWSYS_NAME_IS_KWSYS=0
KWSYS_BUILD_SHARED=0