summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorGregor Jasny <gjasny@googlemail.com>2017-02-24 17:47:58 (GMT)
committerGregor Jasny <gjasny@googlemail.com>2017-02-28 21:38:29 (GMT)
commitf4977d056b2295679ce723c639f16823cfe489d5 (patch)
treeec863c21abdeee9175abc70ec2d2656a1a156270 /Source
parent7202db5db46bfe7499244af315249820e883c8cf (diff)
downloadCMake-f4977d056b2295679ce723c639f16823cfe489d5.zip
CMake-f4977d056b2295679ce723c639f16823cfe489d5.tar.gz
CMake-f4977d056b2295679ce723c639f16823cfe489d5.tar.bz2
Xcode: Select executable target for execution in schema
Diffstat (limited to 'Source')
-rw-r--r--Source/cmXCodeScheme.cxx23
-rw-r--r--Source/cmXCodeScheme.h3
2 files changed, 24 insertions, 2 deletions
diff --git a/Source/cmXCodeScheme.cxx b/Source/cmXCodeScheme.cxx
index e5031fd..1596e5c 100644
--- a/Source/cmXCodeScheme.cxx
+++ b/Source/cmXCodeScheme.cxx
@@ -13,7 +13,8 @@
cmXCodeScheme::cmXCodeScheme(cmXCodeObject* xcObj,
const std::vector<std::string>& configList,
unsigned int xcVersion)
- : TargetName(xcObj->GetTarget()->GetName())
+ : Target(xcObj)
+ , TargetName(xcObj->GetTarget()->GetName())
, TargetId(xcObj->GetId())
, ConfigList(configList)
, XcodeVersion(xcVersion)
@@ -135,7 +136,14 @@ void cmXCodeScheme::WriteLaunchAction(cmXMLWriter& xout,
xout.Attribute("debugServiceExtension", "internal");
xout.Attribute("allowLocationSimulation", "YES");
- xout.StartElement("MacroExpansion");
+ if (IsExecutable(this->Target)) {
+ xout.StartElement("BuildableProductRunnable");
+ xout.BreakAttributes();
+ xout.Attribute("runnableDebuggingMode", "0");
+
+ } else {
+ xout.StartElement("MacroExpansion");
+ }
xout.StartElement("BuildableReference");
xout.BreakAttributes();
@@ -205,3 +213,14 @@ std::string cmXCodeScheme::FindConfiguration(const std::string& name)
return name;
}
+
+bool cmXCodeScheme::IsExecutable(const cmXCodeObject* target)
+{
+ cmGeneratorTarget* gt = target->GetTarget();
+ if (!gt) {
+ cmSystemTools::Error("Error no target on xobject\n");
+ return false;
+ }
+
+ return gt->GetType() == cmStateEnums::EXECUTABLE;
+}
diff --git a/Source/cmXCodeScheme.h b/Source/cmXCodeScheme.h
index 7a7d930..470b5fd 100644
--- a/Source/cmXCodeScheme.h
+++ b/Source/cmXCodeScheme.h
@@ -24,6 +24,7 @@ public:
const std::string& container);
private:
+ const cmXCodeObject* const Target;
const std::string& TargetName;
const std::string& TargetId;
const std::vector<std::string>& ConfigList;
@@ -41,6 +42,8 @@ private:
std::string WriteVersionString();
std::string FindConfiguration(const std::string& name);
+
+ static bool IsExecutable(const cmXCodeObject* target);
};
#endif