diff options
Diffstat (limited to 'Source/cmXCodeScheme.cxx')
-rw-r--r-- | Source/cmXCodeScheme.cxx | 29 |
1 files changed, 17 insertions, 12 deletions
diff --git a/Source/cmXCodeScheme.cxx b/Source/cmXCodeScheme.cxx index b34c2f6..f4c2f2d 100644 --- a/Source/cmXCodeScheme.cxx +++ b/Source/cmXCodeScheme.cxx @@ -7,6 +7,8 @@ #include <sstream> #include <utility> +#include <cmext/algorithm> + #include "cmGeneratedFileStream.h" #include "cmGeneratorExpression.h" #include "cmGeneratorTarget.h" @@ -202,14 +204,14 @@ void cmXCodeScheme::WriteLaunchAction(cmXMLWriter& xout, // Info tab begin - if (const char* exe = + if (cmProp exe = this->Target->GetTarget()->GetProperty("XCODE_SCHEME_EXECUTABLE")) { xout.StartElement("PathRunnable"); xout.BreakAttributes(); xout.Attribute("runnableDebuggingMode", "0"); - xout.Attribute("FilePath", exe); + xout.Attribute("FilePath", *exe); xout.EndElement(); // PathRunnable } @@ -218,9 +220,9 @@ void cmXCodeScheme::WriteLaunchAction(cmXMLWriter& xout, // Arguments tab begin - if (const char* argList = + if (cmProp argList = this->Target->GetTarget()->GetProperty("XCODE_SCHEME_ARGUMENTS")) { - std::vector<std::string> arguments = cmExpandedList(argList); + std::vector<std::string> arguments = cmExpandedList(*argList); if (!arguments.empty()) { xout.StartElement("CommandLineArguments"); @@ -238,9 +240,9 @@ void cmXCodeScheme::WriteLaunchAction(cmXMLWriter& xout, } } - if (const char* envList = + if (cmProp envList = this->Target->GetTarget()->GetProperty("XCODE_SCHEME_ENVIRONMENT")) { - std::vector<std::string> envs = cmExpandedList(envList); + std::vector<std::string> envs = cmExpandedList(*envList); if (!envs.empty()) { xout.StartElement("EnvironmentVariables"); @@ -321,8 +323,9 @@ bool cmXCodeScheme::WriteLaunchActionBooleanAttribute( cmXMLWriter& xout, const std::string& attrName, const std::string& varName, bool defaultValue) { - auto property = Target->GetTarget()->GetProperty(varName); - bool isOn = (property == nullptr && defaultValue) || cmIsOn(property); + cmProp property = Target->GetTarget()->GetProperty(varName); + bool isOn = + (property == nullptr && defaultValue) || (property && cmIsOn(*property)); if (isOn) { xout.Attribute(attrName.c_str(), "YES"); @@ -393,7 +396,8 @@ void cmXCodeScheme::WriteBuildableReference(cmXMLWriter& xout, xout.BreakAttributes(); xout.Attribute("BuildableIdentifier", "primary"); xout.Attribute("BlueprintIdentifier", xcObj->GetId()); - xout.Attribute("BuildableName", xcObj->GetTarget()->GetFullName()); + std::string const noConfig; // FIXME: What config to use here? + xout.Attribute("BuildableName", xcObj->GetTarget()->GetFullName(noConfig)); xout.Attribute("BlueprintName", xcObj->GetTarget()->GetName()); xout.Attribute("ReferencedContainer", "container:" + container); xout.EndElement(); @@ -402,8 +406,9 @@ void cmXCodeScheme::WriteBuildableReference(cmXMLWriter& xout, void cmXCodeScheme::WriteCustomWorkingDirectory( cmXMLWriter& xout, const std::string& configuration) { - std::string propertyValue = this->Target->GetTarget()->GetSafeProperty( - "XCODE_SCHEME_WORKING_DIRECTORY"); + std::string const& propertyValue = + this->Target->GetTarget()->GetSafeProperty( + "XCODE_SCHEME_WORKING_DIRECTORY"); if (propertyValue.empty()) { xout.Attribute("useCustomWorkingDirectory", "NO"); } else { @@ -427,7 +432,7 @@ std::string cmXCodeScheme::FindConfiguration(const std::string& name) // Try to find the desired configuration by name, // and if it's not found return first from the list // - if (!cmContains(this->ConfigList, name) && !this->ConfigList.empty()) { + if (!cm::contains(this->ConfigList, name) && !this->ConfigList.empty()) { return this->ConfigList[0]; } |