mirror of
https://github.com/Kitware/CMake.git
synced 2026-04-26 16:18:43 -05:00
@@ -10,10 +10,11 @@
|
||||
#include "cmGeneratorTarget.h"
|
||||
#include "cmXMLSafe.h"
|
||||
|
||||
cmXCodeScheme::cmXCodeScheme(cmXCodeObject* xcObj,
|
||||
cmXCodeScheme::cmXCodeScheme(cmXCodeObject* xcObj, const TestObjects& tests,
|
||||
const std::vector<std::string>& configList,
|
||||
unsigned int xcVersion)
|
||||
: Target(xcObj)
|
||||
, Tests(tests)
|
||||
, TargetName(xcObj->GetTarget()->GetName())
|
||||
, ConfigList(configList)
|
||||
, XcodeVersion(xcVersion)
|
||||
@@ -56,7 +57,7 @@ void cmXCodeScheme::WriteXCodeXCScheme(std::ostream& fout,
|
||||
xout.Attribute("version", "1.3");
|
||||
|
||||
WriteBuildAction(xout, container);
|
||||
WriteTestAction(xout, FindConfiguration("Debug"));
|
||||
WriteTestAction(xout, FindConfiguration("Debug"), container);
|
||||
WriteLaunchAction(xout, FindConfiguration("Debug"), container);
|
||||
WriteProfileAction(xout, FindConfiguration("Release"));
|
||||
WriteAnalyzeAction(xout, FindConfiguration("Debug"));
|
||||
@@ -90,7 +91,8 @@ void cmXCodeScheme::WriteBuildAction(cmXMLWriter& xout,
|
||||
}
|
||||
|
||||
void cmXCodeScheme::WriteTestAction(cmXMLWriter& xout,
|
||||
std::string configuration)
|
||||
std::string configuration,
|
||||
const std::string& container)
|
||||
{
|
||||
xout.StartElement("TestAction");
|
||||
xout.BreakAttributes();
|
||||
@@ -102,8 +104,22 @@ void cmXCodeScheme::WriteTestAction(cmXMLWriter& xout,
|
||||
xout.Attribute("shouldUseLaunchSchemeArgsEnv", "YES");
|
||||
|
||||
xout.StartElement("Testables");
|
||||
for (TestObjects::const_iterator it = this->Tests.begin();
|
||||
it != this->Tests.end(); ++it) {
|
||||
xout.StartElement("TestableReference");
|
||||
xout.BreakAttributes();
|
||||
xout.Attribute("skipped", "NO");
|
||||
WriteBuildableReference(xout, *it, container);
|
||||
xout.EndElement(); // TestableReference
|
||||
}
|
||||
xout.EndElement();
|
||||
|
||||
if (IsTestable()) {
|
||||
xout.StartElement("MacroExpansion");
|
||||
WriteBuildableReference(xout, this->Target, container);
|
||||
xout.EndElement(); // MacroExpansion
|
||||
}
|
||||
|
||||
xout.StartElement("AdditionalOptions");
|
||||
xout.EndElement();
|
||||
|
||||
@@ -213,6 +229,11 @@ std::string cmXCodeScheme::FindConfiguration(const std::string& name)
|
||||
return name;
|
||||
}
|
||||
|
||||
bool cmXCodeScheme::IsTestable() const
|
||||
{
|
||||
return !this->Tests.empty() || IsExecutable(this->Target);
|
||||
}
|
||||
|
||||
bool cmXCodeScheme::IsExecutable(const cmXCodeObject* target)
|
||||
{
|
||||
cmGeneratorTarget* gt = target->GetTarget();
|
||||
|
||||
Reference in New Issue
Block a user