diff options
author | Vitaly Stakhovsky <vvs31415@gitlab.org> | 2018-12-30 19:31:53 (GMT) |
---|---|---|
committer | Vitaly Stakhovsky <vvs31415@gitlab.org> | 2018-12-31 16:50:40 (GMT) |
commit | 1cf9c754db3fcdcd500dbec48e509535135eba1b (patch) | |
tree | 232ea9e7f66863fb040b79ce3cb3073baa7298aa /Source/cmGhsMultiTargetGenerator.cxx | |
parent | ae8525b82f03d3ce0c1e880e62bec0956f90839b (diff) | |
download | CMake-1cf9c754db3fcdcd500dbec48e509535135eba1b.zip CMake-1cf9c754db3fcdcd500dbec48e509535135eba1b.tar.gz CMake-1cf9c754db3fcdcd500dbec48e509535135eba1b.tar.bz2 |
Source: Modernize for loops, add const modifiers
Diffstat (limited to 'Source/cmGhsMultiTargetGenerator.cxx')
-rw-r--r-- | Source/cmGhsMultiTargetGenerator.cxx | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/Source/cmGhsMultiTargetGenerator.cxx b/Source/cmGhsMultiTargetGenerator.cxx index 4d98d55..1a25633 100644 --- a/Source/cmGhsMultiTargetGenerator.cxx +++ b/Source/cmGhsMultiTargetGenerator.cxx @@ -196,7 +196,7 @@ void cmGhsMultiTargetGenerator::WriteTypeSpecifics(const std::string& config, std::string outputFilename(this->GetOutputFilename(config)); if (this->GeneratorTarget->GetType() == cmStateEnums::STATIC_LIBRARY) { - std::string const static_library_suffix = + std::string const& static_library_suffix = this->Makefile->GetSafeDefinition("CMAKE_STATIC_LIBRARY_SUFFIX"); *this->GetFolderBuildStreams() << " -o \"" << outputDir << outputFilename << static_library_suffix @@ -478,10 +478,9 @@ void cmGhsMultiTargetGenerator::WriteSources( std::vector<cmSourceFile*> const& objectSources, std::map<const cmSourceFile*, std::string> const& objectNames) { - for (std::vector<cmSourceFile*>::const_iterator si = objectSources.begin(); - si != objectSources.end(); ++si) { + for (const cmSourceFile* sf : objectSources) { std::vector<cmSourceGroup> sourceGroups(this->Makefile->GetSourceGroups()); - std::string const& sourceFullPath = (*si)->GetFullPath(); + std::string const& sourceFullPath = sf->GetFullPath(); cmSourceGroup* sourceGroup = this->Makefile->FindSourceGroup(sourceFullPath, sourceGroups); std::string sgPath = sourceGroup->GetFullName(); @@ -491,8 +490,8 @@ void cmGhsMultiTargetGenerator::WriteSources( this->LocalGenerator->GetBinaryDirectory().c_str(), sgPath, GhsMultiGpj::SUBPROJECT, this->RelBuildFilePath); - std::string fullSourcePath((*si)->GetFullPath()); - if ((*si)->GetExtension() == "int" || (*si)->GetExtension() == "bsp") { + std::string fullSourcePath(sf->GetFullPath()); + if (sf->GetExtension() == "int" || sf->GetExtension() == "bsp") { *this->FolderBuildStreams[sgPath] << fullSourcePath << std::endl; } else { // WORKAROUND: GHS MULTI needs the path to use backslashes without quotes @@ -501,12 +500,12 @@ void cmGhsMultiTargetGenerator::WriteSources( *this->FolderBuildStreams[sgPath] << fullSourcePath << std::endl; } - if ("ld" != (*si)->GetExtension() && "int" != (*si)->GetExtension() && - "bsp" != (*si)->GetExtension()) { - this->WriteObjectLangOverride(this->FolderBuildStreams[sgPath], (*si)); - if (objectNames.end() != objectNames.find(*si)) { + if ("ld" != sf->GetExtension() && "int" != sf->GetExtension() && + "bsp" != sf->GetExtension()) { + this->WriteObjectLangOverride(this->FolderBuildStreams[sgPath], sf); + if (objectNames.end() != objectNames.find(sf)) { *this->FolderBuildStreams[sgPath] - << " -o \"" << objectNames.find(*si)->second << "\"" << std::endl; + << " -o \"" << objectNames.find(sf)->second << "\"" << std::endl; } this->WriteObjectDir(this->FolderBuildStreams[sgPath], @@ -516,7 +515,7 @@ void cmGhsMultiTargetGenerator::WriteSources( } void cmGhsMultiTargetGenerator::WriteObjectLangOverride( - cmGeneratedFileStream* fileStream, cmSourceFile* sourceFile) + cmGeneratedFileStream* fileStream, const cmSourceFile* sourceFile) { const char* rawLangProp = sourceFile->GetProperty("LANGUAGE"); if (NULL != rawLangProp) { |