cmTarget: Track internally whether platform is Android

Add an IsAndroid member to save whether CMAKE_SYSTEM_NAME is "Android".
This commit is contained in:
Brad King 2014-07-24 15:03:04 -04:00
parent ef0fd4f0ce
commit 16569abfa8
2 changed files with 7 additions and 0 deletions

View File

@ -257,6 +257,7 @@ cmTarget::cmTarget()
#endif #endif
this->HaveInstallRule = false; this->HaveInstallRule = false;
this->DLLPlatform = false; this->DLLPlatform = false;
this->IsAndroid = false;
this->IsApple = false; this->IsApple = false;
this->IsImportedTarget = false; this->IsImportedTarget = false;
this->BuildInterfaceIncludesAppended = false; this->BuildInterfaceIncludesAppended = false;
@ -312,6 +313,11 @@ void cmTarget::SetMakefile(cmMakefile* mf)
this->Makefile->IsOn("CYGWIN") || this->Makefile->IsOn("CYGWIN") ||
this->Makefile->IsOn("MINGW")); 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. // Check whether we are targeting an Apple platform.
this->IsApple = this->Makefile->IsOn("APPLE"); this->IsApple = this->Makefile->IsOn("APPLE");

View File

@ -755,6 +755,7 @@ private:
mutable cmPropertyMap Properties; mutable cmPropertyMap Properties;
LinkLibraryVectorType OriginalLinkLibraries; LinkLibraryVectorType OriginalLinkLibraries;
bool DLLPlatform; bool DLLPlatform;
bool IsAndroid;
bool IsApple; bool IsApple;
bool IsImportedTarget; bool IsImportedTarget;
mutable bool DebugIncludesDone; mutable bool DebugIncludesDone;