From dd968ca38828f45b40a8270783b9a7ef53074f25 Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Wed, 1 Feb 2023 12:01:21 -0500 Subject: cmTarget: convert VS property settings to the new property lambda --- Source/cmTarget.cxx | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx index 8b06031..e8d66cc 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -936,20 +936,6 @@ cmTarget::cmTarget(std::string const& name, cmStateEnums::TargetType type, this->impl->IsAndroid = (this->impl->Makefile->GetSafeDefinition( "CMAKE_SYSTEM_NAME") == "Android"); - std::string defKey; - defKey.reserve(128); - defKey += "CMAKE_"; - auto initPropValue = [this, mf, &defKey](const std::string& property, - const char* default_value) { - // Replace everything after "CMAKE_" - defKey.replace(defKey.begin() + 6, defKey.end(), property); - if (cmValue value = mf->GetDefinition(defKey)) { - this->SetProperty(property, value); - } else if (default_value) { - this->SetProperty(property, default_value); - } - }; - // Save the backtrace of target construction. this->impl->Backtrace = this->impl->Makefile->GetBacktrace(); @@ -1037,6 +1023,9 @@ cmTarget::cmTarget(std::string const& name, cmStateEnums::TargetType type, config = cmSystemTools::UpperCase(config); } + std::string defKey; + defKey.reserve(128); + defKey += "CMAKE_"; auto initProperty = [this, mf, &defKey](const std::string& property, const char* default_value) { // Replace everything after "CMAKE_" @@ -1096,7 +1085,7 @@ cmTarget::cmTarget(std::string const& name, cmStateEnums::TargetType type, if (assignment != std::string::npos) { const std::string propName = vsGlobal + i.substr(0, assignment); const std::string propValue = i.substr(assignment + 1); - initPropValue(propName, propValue.c_str()); + initProperty(propName, propValue.c_str()); } } } -- cgit v0.12