From 7550879f570502f31aeafbd48f04bafd17234696 Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Sat, 10 Oct 2015 00:15:38 +0200 Subject: cmGeneratorTarget: Move IsXCTestOnApple from cmTarget. --- Source/cmGeneratorTarget.cxx | 9 ++++++++- Source/cmGeneratorTarget.h | 3 +++ Source/cmGlobalXCodeGenerator.cxx | 4 ++-- Source/cmTarget.cxx | 7 ------- Source/cmTarget.h | 3 --- 5 files changed, 13 insertions(+), 13 deletions(-) diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx index ab0d02b..7e457bb 100644 --- a/Source/cmGeneratorTarget.cxx +++ b/Source/cmGeneratorTarget.cxx @@ -1587,7 +1587,7 @@ std::string cmGeneratorTarget::GetCFBundleDirectory(const std::string& config, const char *ext = this->GetProperty("BUNDLE_EXTENSION"); if (!ext) { - if (this->Target->IsXCTestOnApple()) + if (this->IsXCTestOnApple()) { ext = "xctest"; } @@ -5962,3 +5962,10 @@ bool cmGeneratorTarget::IsAppBundleOnApple() const this->Makefile->IsOn("APPLE") && this->GetPropertyAsBool("MACOSX_BUNDLE")); } + +//---------------------------------------------------------------------------- +bool cmGeneratorTarget::IsXCTestOnApple() const +{ + return (this->Target->IsCFBundleOnApple() && + this->GetPropertyAsBool("XCTEST")); +} diff --git a/Source/cmGeneratorTarget.h b/Source/cmGeneratorTarget.h index 24a1c2c..ce2f42e 100644 --- a/Source/cmGeneratorTarget.h +++ b/Source/cmGeneratorTarget.h @@ -422,6 +422,9 @@ public: /** Return whether this target is an executable Bundle on Apple. */ bool IsAppBundleOnApple() const; + /** Return whether this target is a XCTest on Apple. */ + bool IsXCTestOnApple() const; + struct SourceFileFlags GetTargetSourceFileFlags(const cmSourceFile* sf) const; diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx index 527a84f..a489767 100644 --- a/Source/cmGlobalXCodeGenerator.cxx +++ b/Source/cmGlobalXCodeGenerator.cxx @@ -2651,7 +2651,7 @@ const char* cmGlobalXCodeGenerator::GetTargetFileType( case cmState::STATIC_LIBRARY: return "archive.ar"; case cmState::MODULE_LIBRARY: - if (target->Target->IsXCTestOnApple()) + if (target->IsXCTestOnApple()) return "wrapper.cfbundle"; else if (target->Target->IsCFBundleOnApple()) return "wrapper.plug-in"; @@ -2678,7 +2678,7 @@ const char* cmGlobalXCodeGenerator::GetTargetProductType( case cmState::STATIC_LIBRARY: return "com.apple.product-type.library.static"; case cmState::MODULE_LIBRARY: - if (target->Target->IsXCTestOnApple()) + if (target->IsXCTestOnApple()) return "com.apple.product-type.bundle.unit-test"; else if (target->Target->IsCFBundleOnApple()) return "com.apple.product-type.bundle"; diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx index 761267d..02a5ea6 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -377,13 +377,6 @@ bool cmTarget::IsCFBundleOnApple() const } //---------------------------------------------------------------------------- -bool cmTarget::IsXCTestOnApple() const -{ - return (this->IsCFBundleOnApple() && - this->GetPropertyAsBool("XCTEST")); -} - -//---------------------------------------------------------------------------- void cmTarget::AddTracedSources(std::vector const& srcs) { if (!srcs.empty()) diff --git a/Source/cmTarget.h b/Source/cmTarget.h index 51e97fd..7cf4808 100644 --- a/Source/cmTarget.h +++ b/Source/cmTarget.h @@ -238,9 +238,6 @@ public: /** Return whether this target is a CFBundle (plugin) on Apple. */ bool IsCFBundleOnApple() const; - /** Return whether this target is a XCTest on Apple. */ - bool IsXCTestOnApple() const; - /** Return whether this target is an executable Bundle on Apple. */ bool IsAppBundleOnApple() const; -- cgit v0.12