summaryrefslogtreecommitdiff
path: root/Source
diff options
context:
space:
mode:
authorKyle Edwards <kyle.edwards@kitware.com>2020-06-17 14:48:49 -0400
committerKyle Edwards <kyle.edwards@kitware.com>2020-06-18 15:35:26 -0400
commitbbcaf9689ea76d8deba13870dfc63f0654348b5a (patch)
treedee3895c9ee330b5329ef560617e765aa297bab2 /Source
parent14456923bd79b5353cf8be49855ac01826d89b70 (diff)
downloadcmake-bbcaf9689ea76d8deba13870dfc63f0654348b5a.tar.gz
Refactor: Add IsAndroidGuiExecutable() method to cmTarget
Diffstat (limited to 'Source')
-rw-r--r--Source/cmTarget.cxx10
-rw-r--r--Source/cmTarget.h3
-rw-r--r--Source/cmVisualStudio10TargetGenerator.cxx5
3 files changed, 13 insertions, 5 deletions
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index 36e1ad5fd1..4091b065f6 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -636,6 +636,12 @@ bool cmTarget::IsAppBundleOnApple() const
this->GetPropertyAsBool("MACOSX_BUNDLE"));
}
+bool cmTarget::IsAndroidGuiExecutable() const
+{
+ return (this->GetType() == cmStateEnums::EXECUTABLE && impl->IsAndroid &&
+ this->GetPropertyAsBool("ANDROID_GUI"));
+}
+
std::vector<cmCustomCommand> const& cmTarget::GetPreBuildCommands() const
{
return impl->PreBuildCommands;
@@ -1865,7 +1871,7 @@ const char* cmTarget::GetSuffixVariableInternal(
case cmStateEnums::RuntimeBinaryArtifact:
// Android GUI application packages store the native
// binary as a shared library.
- return (impl->IsAndroid && this->GetPropertyAsBool("ANDROID_GUI")
+ return (this->IsAndroidGuiExecutable()
? "CMAKE_SHARED_LIBRARY_SUFFIX"
: "CMAKE_EXECUTABLE_SUFFIX");
case cmStateEnums::ImportLibraryArtifact:
@@ -1906,7 +1912,7 @@ const char* cmTarget::GetPrefixVariableInternal(
case cmStateEnums::RuntimeBinaryArtifact:
// Android GUI application packages store the native
// binary as a shared library.
- return (impl->IsAndroid && this->GetPropertyAsBool("ANDROID_GUI")
+ return (this->IsAndroidGuiExecutable()
? "CMAKE_SHARED_LIBRARY_PREFIX"
: "");
case cmStateEnums::ImportLibraryArtifact:
diff --git a/Source/cmTarget.h b/Source/cmTarget.h
index f0ddb686a7..e7498bd7ad 100644
--- a/Source/cmTarget.h
+++ b/Source/cmTarget.h
@@ -209,6 +209,9 @@ public:
//! Return whether this target is an executable Bundle on Apple.
bool IsAppBundleOnApple() const;
+ //! Return whether this target is a GUI executable on Android.
+ bool IsAndroidGuiExecutable() const;
+
//! Get a backtrace from the creation of the target.
cmListFileBacktrace const& GetBacktrace() const;
diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx
index a3ccd2baee..31bb7bedd2 100644
--- a/Source/cmVisualStudio10TargetGenerator.cxx
+++ b/Source/cmVisualStudio10TargetGenerator.cxx
@@ -1134,7 +1134,7 @@ void cmVisualStudio10TargetGenerator::WriteProjectConfigurationValues(Elem& e0)
break;
case cmStateEnums::EXECUTABLE:
if (this->NsightTegra &&
- !this->GeneratorTarget->GetPropertyAsBool("ANDROID_GUI")) {
+ !this->GeneratorTarget->Target->IsAndroidGuiExecutable()) {
// Android executables are .so too.
configType = "DynamicLibrary";
} else {
@@ -4015,8 +4015,7 @@ void cmVisualStudio10TargetGenerator::WriteItemDefinitionGroups(Elem& e0)
// output manifest flags <Manifest></Manifest>
this->WriteManifestOptions(e1, c);
if (this->NsightTegra &&
- this->GeneratorTarget->GetType() == cmStateEnums::EXECUTABLE &&
- this->GeneratorTarget->GetPropertyAsBool("ANDROID_GUI")) {
+ this->GeneratorTarget->Target->IsAndroidGuiExecutable()) {
this->WriteAntBuildOptions(e1, c);
}
}