diff options
Diffstat (limited to 'Source/cmTarget.cxx')
-rw-r--r-- | Source/cmTarget.cxx | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx index 93cdd46..46f930a 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -5,6 +5,7 @@ #include "cmsys/RegularExpression.hxx" #include <algorithm> #include <assert.h> +#include <initializer_list> #include <iterator> #include <set> #include <sstream> @@ -20,6 +21,7 @@ #include "cmMessageType.h" #include "cmMessenger.h" #include "cmProperty.h" +#include "cmRange.h" #include "cmSourceFile.h" #include "cmSourceFileLocation.h" #include "cmSourceFileLocationKind.h" @@ -312,23 +314,23 @@ cmTarget::cmTarget(std::string const& name, cmStateEnums::TargetType type, // Setup per-configuration property default values. if (this->GetType() != cmStateEnums::UTILITY) { - const char* configProps[] = { + static const auto configProps = { /* clang-format needs this comment to break after the opening brace */ "ARCHIVE_OUTPUT_DIRECTORY_", "LIBRARY_OUTPUT_DIRECTORY_", "RUNTIME_OUTPUT_DIRECTORY_", "PDB_OUTPUT_DIRECTORY_", "COMPILE_PDB_OUTPUT_DIRECTORY_", "MAP_IMPORTED_CONFIG_", - "INTERPROCEDURAL_OPTIMIZATION_", nullptr + "INTERPROCEDURAL_OPTIMIZATION_" }; for (std::string const& configName : configNames) { std::string configUpper = cmSystemTools::UpperCase(configName); - for (const char** p = configProps; *p; ++p) { + for (auto const& prop : configProps) { // Interface libraries have no output locations, so honor only // the configuration map. if (this->TargetTypeValue == cmStateEnums::INTERFACE_LIBRARY && - strcmp(*p, "MAP_IMPORTED_CONFIG_") != 0) { + strcmp(prop, "MAP_IMPORTED_CONFIG_") != 0) { continue; } - std::string property = *p; + std::string property = prop; property += configUpper; this->SetPropertyDefault(property, nullptr); } @@ -707,10 +709,8 @@ std::string cmTarget::GetDebugGeneratorExpressions( std::string configString = "$<CONFIG:" + debugConfigs[0] + ">"; if (debugConfigs.size() > 1) { - for (std::vector<std::string>::const_iterator li = - debugConfigs.begin() + 1; - li != debugConfigs.end(); ++li) { - configString += ",$<CONFIG:" + *li + ">"; + for (std::string const& conf : cmMakeRange(debugConfigs).advance(1)) { + configString += ",$<CONFIG:" + conf + ">"; } configString = "$<OR:" + configString + ">"; } |