summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/Android/android.h
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2016-08-24 13:45:50 (GMT)
committerCMake Topic Stage <kwrobot@kitware.com>2016-08-24 13:45:50 (GMT)
commit96de37092a29cb2e7a92e9cb10b0ef47bca32732 (patch)
treeddaacef7de12a87abd0e5c446cde824290076828 /Tests/RunCMake/Android/android.h
parentccddb454b8e7ae3ae075db5fd3233ce86c8c70cb (diff)
parent7b637ebdc97655462d08d8ff70bee5d4f32e4681 (diff)
downloadCMake-96de37092a29cb2e7a92e9cb10b0ef47bca32732.zip
CMake-96de37092a29cb2e7a92e9cb10b0ef47bca32732.tar.gz
CMake-96de37092a29cb2e7a92e9cb10b0ef47bca32732.tar.bz2
Merge topic 'android-platform-modules'
7b637ebd Android: Add `ANDROID` variable to indicate the target c2f561e5 Android: Add test cases covering use of the NDK and standalone toolchains 6b84df8d Help: Document cross compiling for Android d7d40830 Android: Select the STL type for NDK builds b22294bc Android: Populate compiler flags for current ABI b6a3102a Android: Add a CMAKE_BUILD_TYPE default d1e3cec2 Android: Add Clang -target option for current ABI 504db72d Android: Add placeholders for compiler/abi-specific settings fa632578 Android: Avoid interfering with common pre-existing toolchain files 6299693f Android: Search for NDK and standalone toolchain in more places 29b51379 Android: Detect and save a standalone toolchain without the NDK 7d9b49fb Android: Detect settings from the CMAKE_SYSROOT if it is set 4389664a Android: Detect and save a toolchain from the NDK 328191f6 Android: Set CMAKE_SYSROOT automatically 9e032304 Android: Detect and save the architecture, ABI, and processor fde59c4d Android: Detect and save the API level ...
Diffstat (limited to 'Tests/RunCMake/Android/android.h')
-rw-r--r--Tests/RunCMake/Android/android.h103
1 files changed, 103 insertions, 0 deletions
diff --git a/Tests/RunCMake/Android/android.h b/Tests/RunCMake/Android/android.h
new file mode 100644
index 0000000..a5fd67e
--- /dev/null
+++ b/Tests/RunCMake/Android/android.h
@@ -0,0 +1,103 @@
+#ifndef __ANDROID__
+#error "__ANDROID__ not defined"
+#endif
+
+#include <android/api-level.h>
+
+#if API_LEVEL != __ANDROID_API__
+#error "API levels do not match"
+#endif
+
+#ifdef COMPILER_IS_CLANG
+#ifndef __clang__
+#error "COMPILER_IS_CLANG but __clang__ is not defined"
+#endif
+#else
+#ifdef __clang__
+#error "!COMPILER_IS_CLANG but __clang__ is defined"
+#endif
+#endif
+
+#ifdef ARM_MODE
+#if ARM_MODE == 1 && defined(__thumb__)
+#error "ARM_MODE==1 but __thumb__ is defined"
+#elif ARM_MODE == 0 && !defined(__thumb__)
+#error "ARM_MODE==0 but __thumb__ is not defined"
+#endif
+#endif
+
+#ifdef ARM_NEON
+#if ARM_NEON == 0 && defined(__ARM_NEON__)
+#error "ARM_NEON==0 but __ARM_NEON__ is defined"
+#elif ARM_NEON == 1 && !defined(__ARM_NEON__)
+#error "ARM_NEON==1 but __ARM_NEON__ is not defined"
+#endif
+#endif
+
+#ifdef ABI_armeabi
+#ifndef __ARM_EABI__
+#error "ABI_armeabi: __ARM_EABI__ not defined"
+#endif
+#if __ARM_ARCH != 5
+#error "ABI_armeabi: __ARM_ARCH is not 5"
+#endif
+#endif
+
+#ifdef ABI_armeabi_v6
+#ifndef __ARM_EABI__
+#error "ABI_armeabi_v6: __ARM_EABI__ not defined"
+#endif
+#if __ARM_ARCH != 6
+#error "ABI_armeabi_v6: __ARM_ARCH is not 6"
+#endif
+#endif
+
+#ifdef ABI_armeabi_v7a
+#ifndef __ARM_EABI__
+#error "ABI_armeabi_v7a: __ARM_EABI__ not defined"
+#endif
+#if __ARM_ARCH != 7
+#error "ABI_armeabi_v7a: __ARM_ARCH is not 7"
+#endif
+#endif
+
+#ifdef ABI_arm64_v8a
+#ifdef __ARM_EABI__
+#error "ABI_arm64_v8a: __ARM_EABI__ defined"
+#endif
+#ifndef __aarch64__
+#error "ABI_arm64_v8a: __aarch64__ not defined"
+#endif
+#endif
+
+#ifdef ABI_mips
+#if __mips != 32
+#error "ABI_mips: __mips != 32"
+#endif
+#ifndef _ABIO32
+#error "ABI_mips: _ABIO32 not defined"
+#endif
+#endif
+
+#ifdef ABI_mips64
+#if __mips != 64
+#error "ABI_mips64: __mips != 64"
+#endif
+#ifndef _ABI64
+#error "ABI_mips: _ABI64 not defined"
+#endif
+#endif
+
+#ifdef ABI_x86
+#ifndef __i686__
+#error "ABI_x86: __i686__ not defined"
+#endif
+#endif
+
+#ifdef ABI_x86_64
+#ifndef __x86_64__
+#error "ABI_x86_64: __x86_64__ not defined"
+#endif
+#endif
+
+#include <stddef.h>