From 47866770cee381851ccc8070f64459909a838288 Mon Sep 17 00:00:00 2001 From: Brad King Date: Thu, 2 Jun 2016 10:16:11 -0400 Subject: [PATCH] Android: Add placeholders for platform-specific compiler settings Add infrastructure modules to be loaded for Clang and GNU compilers when targeting Android platforms. --- Modules/Platform/Android-Clang-C.cmake | 2 ++ Modules/Platform/Android-Clang-CXX.cmake | 2 ++ Modules/Platform/Android-Clang.cmake | 24 ++++++++++++++++++++++++ Modules/Platform/Android-Common.cmake | 21 +++++++++++++++++++++ Modules/Platform/Android-GNU-C.cmake | 2 ++ Modules/Platform/Android-GNU-CXX.cmake | 2 ++ Modules/Platform/Android-GNU.cmake | 24 ++++++++++++++++++++++++ 7 files changed, 77 insertions(+) create mode 100644 Modules/Platform/Android-Clang-C.cmake create mode 100644 Modules/Platform/Android-Clang-CXX.cmake create mode 100644 Modules/Platform/Android-Clang.cmake create mode 100644 Modules/Platform/Android-Common.cmake create mode 100644 Modules/Platform/Android-GNU-C.cmake create mode 100644 Modules/Platform/Android-GNU-CXX.cmake create mode 100644 Modules/Platform/Android-GNU.cmake diff --git a/Modules/Platform/Android-Clang-C.cmake b/Modules/Platform/Android-Clang-C.cmake new file mode 100644 index 000000000..9e16911ad --- /dev/null +++ b/Modules/Platform/Android-Clang-C.cmake @@ -0,0 +1,2 @@ +include(Platform/Android-Clang) +__android_compiler_clang(C) diff --git a/Modules/Platform/Android-Clang-CXX.cmake b/Modules/Platform/Android-Clang-CXX.cmake new file mode 100644 index 000000000..711183645 --- /dev/null +++ b/Modules/Platform/Android-Clang-CXX.cmake @@ -0,0 +1,2 @@ +include(Platform/Android-Clang) +__android_compiler_clang(CXX) diff --git a/Modules/Platform/Android-Clang.cmake b/Modules/Platform/Android-Clang.cmake new file mode 100644 index 000000000..b354b4c46 --- /dev/null +++ b/Modules/Platform/Android-Clang.cmake @@ -0,0 +1,24 @@ +#============================================================================= +# Copyright 2015-2016 Kitware, Inc. +# +# Distributed under the OSI-approved BSD License (the "License"); +# see accompanying file Copyright.txt for details. +# +# This software is distributed WITHOUT ANY WARRANTY; without even the +# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# See the License for more information. +#============================================================================= +# (To distribute this file outside of CMake, substitute the full +# License text for the above reference.) + +# This module is shared by multiple languages; use include blocker. +if(__ANDROID_COMPILER_CLANG) + return() +endif() +set(__ANDROID_COMPILER_CLANG 1) + +include(Platform/Android-Common) + +macro(__android_compiler_clang lang) + __android_compiler_common(${lang}) +endmacro() diff --git a/Modules/Platform/Android-Common.cmake b/Modules/Platform/Android-Common.cmake new file mode 100644 index 000000000..0ef951299 --- /dev/null +++ b/Modules/Platform/Android-Common.cmake @@ -0,0 +1,21 @@ +#============================================================================= +# Copyright 2015-2016 Kitware, Inc. +# +# Distributed under the OSI-approved BSD License (the "License"); +# see accompanying file Copyright.txt for details. +# +# This software is distributed WITHOUT ANY WARRANTY; without even the +# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# See the License for more information. +#============================================================================= +# (To distribute this file outside of CMake, substitute the full +# License text for the above reference.) + +# This module is shared by multiple languages; use include blocker. +if(__ANDROID_COMPILER_COMMON) + return() +endif() +set(__ANDROID_COMPILER_COMMON 1) + +macro(__android_compiler_common lang) +endmacro() diff --git a/Modules/Platform/Android-GNU-C.cmake b/Modules/Platform/Android-GNU-C.cmake new file mode 100644 index 000000000..78a6a5006 --- /dev/null +++ b/Modules/Platform/Android-GNU-C.cmake @@ -0,0 +1,2 @@ +include(Platform/Android-GNU) +__android_compiler_gnu(C) diff --git a/Modules/Platform/Android-GNU-CXX.cmake b/Modules/Platform/Android-GNU-CXX.cmake new file mode 100644 index 000000000..41279d1f7 --- /dev/null +++ b/Modules/Platform/Android-GNU-CXX.cmake @@ -0,0 +1,2 @@ +include(Platform/Android-GNU) +__android_compiler_gnu(CXX) diff --git a/Modules/Platform/Android-GNU.cmake b/Modules/Platform/Android-GNU.cmake new file mode 100644 index 000000000..13369d0bc --- /dev/null +++ b/Modules/Platform/Android-GNU.cmake @@ -0,0 +1,24 @@ +#============================================================================= +# Copyright 2015-2016 Kitware, Inc. +# +# Distributed under the OSI-approved BSD License (the "License"); +# see accompanying file Copyright.txt for details. +# +# This software is distributed WITHOUT ANY WARRANTY; without even the +# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# See the License for more information. +#============================================================================= +# (To distribute this file outside of CMake, substitute the full +# License text for the above reference.) + +# This module is shared by multiple languages; use include blocker. +if(__ANDROID_COMPILER_GNU) + return() +endif() +set(__ANDROID_COMPILER_GNU 1) + +include(Platform/Android-Common) + +macro(__android_compiler_gnu lang) + __android_compiler_common(${lang}) +endmacro()