From 16569abfa83ce231b1270282f03aae0b4542c42d Mon Sep 17 00:00:00 2001 From: Brad King Date: Thu, 24 Jul 2014 15:03:04 -0400 Subject: [PATCH] cmTarget: Track internally whether platform is Android Add an IsAndroid member to save whether CMAKE_SYSTEM_NAME is "Android". --- Source/cmTarget.cxx | 6 ++++++ Source/cmTarget.h | 1 + 2 files changed, 7 insertions(+) diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx index acae0b3eb..80c00206d 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -257,6 +257,7 @@ cmTarget::cmTarget() #endif this->HaveInstallRule = false; this->DLLPlatform = false; + this->IsAndroid = false; this->IsApple = false; this->IsImportedTarget = false; this->BuildInterfaceIncludesAppended = false; @@ -312,6 +313,11 @@ void cmTarget::SetMakefile(cmMakefile* mf) this->Makefile->IsOn("CYGWIN") || this->Makefile->IsOn("MINGW")); + // Check whether we are targeting an Android platform. + this->IsAndroid = + strcmp(this->Makefile->GetSafeDefinition("CMAKE_SYSTEM_NAME"), + "Android") == 0; + // Check whether we are targeting an Apple platform. this->IsApple = this->Makefile->IsOn("APPLE"); diff --git a/Source/cmTarget.h b/Source/cmTarget.h index 333e2ae0c..a3ecca060 100644 --- a/Source/cmTarget.h +++ b/Source/cmTarget.h @@ -755,6 +755,7 @@ private: mutable cmPropertyMap Properties; LinkLibraryVectorType OriginalLinkLibraries; bool DLLPlatform; + bool IsAndroid; bool IsApple; bool IsImportedTarget; mutable bool DebugIncludesDone;