summaryrefslogtreecommitdiffstats
path: root/Modules/Platform/Android
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2016-06-02 19:19:20 (GMT)
committerBrad King <brad.king@kitware.com>2016-08-23 16:53:10 (GMT)
commitd7d4083025f3007b862dd500c8f5fc64e105055b (patch)
treeb93117274170ae3b0a4871f8a394974ccefa3e67 /Modules/Platform/Android
parentb22294bc41c3ce62e561c7123c3f489a750dcb66 (diff)
downloadCMake-d7d4083025f3007b862dd500c8f5fc64e105055b.zip
CMake-d7d4083025f3007b862dd500c8f5fc64e105055b.tar.gz
CMake-d7d4083025f3007b862dd500c8f5fc64e105055b.tar.bz2
Android: Select the STL type for NDK builds
Populate standard include directories and link libraries for the platform. Select the STL corresponding to CMAKE_ANDROID_STL_TYPE and matching the current ABI and toolchain to be used. Refer to the NDK sources/cxx-stl/*/Android.mk files for the needed file locations.
Diffstat (limited to 'Modules/Platform/Android')
-rw-r--r--Modules/Platform/Android/ndk-stl-c++.cmake13
-rw-r--r--Modules/Platform/Android/ndk-stl-c++_shared.cmake4
-rw-r--r--Modules/Platform/Android/ndk-stl-c++_static.cmake6
-rw-r--r--Modules/Platform/Android/ndk-stl-gabi++.cmake7
-rw-r--r--Modules/Platform/Android/ndk-stl-gabi++_shared.cmake4
-rw-r--r--Modules/Platform/Android/ndk-stl-gabi++_static.cmake4
-rw-r--r--Modules/Platform/Android/ndk-stl-gnustl.cmake9
-rw-r--r--Modules/Platform/Android/ndk-stl-gnustl_shared.cmake4
-rw-r--r--Modules/Platform/Android/ndk-stl-gnustl_static.cmake4
-rw-r--r--Modules/Platform/Android/ndk-stl-none.cmake2
-rw-r--r--Modules/Platform/Android/ndk-stl-stlport.cmake7
-rw-r--r--Modules/Platform/Android/ndk-stl-stlport_shared.cmake4
-rw-r--r--Modules/Platform/Android/ndk-stl-stlport_static.cmake4
-rw-r--r--Modules/Platform/Android/ndk-stl-system.cmake6
14 files changed, 78 insertions, 0 deletions
diff --git a/Modules/Platform/Android/ndk-stl-c++.cmake b/Modules/Platform/Android/ndk-stl-c++.cmake
new file mode 100644
index 0000000..14748a1
--- /dev/null
+++ b/Modules/Platform/Android/ndk-stl-c++.cmake
@@ -0,0 +1,13 @@
+# <ndk>/sources/cxx-stl/llvm-libc++/Android.mk
+set(_ANDROID_STL_RTTI 1)
+set(_ANDROID_STL_EXCEPTIONS 1)
+macro(__android_stl_cxx lang filename)
+ # Add the include directory.
+ __android_stl_inc(${lang} "${CMAKE_ANDROID_NDK}/sources/cxx-stl/llvm-libc++/libcxx/include" 1)
+
+ # Add a secondary include directory if it exists.
+ __android_stl_inc(${lang} "${CMAKE_ANDROID_NDK}/sources/android/support/include" 0)
+
+ # Add the library file.
+ __android_stl_lib(${lang} "${CMAKE_ANDROID_NDK}/sources/cxx-stl/llvm-libc++/libs/${CMAKE_ANDROID_ARCH_ABI}/${filename}" 1)
+endmacro()
diff --git a/Modules/Platform/Android/ndk-stl-c++_shared.cmake b/Modules/Platform/Android/ndk-stl-c++_shared.cmake
new file mode 100644
index 0000000..f585adb
--- /dev/null
+++ b/Modules/Platform/Android/ndk-stl-c++_shared.cmake
@@ -0,0 +1,4 @@
+include(Platform/Android/ndk-stl-c++)
+macro(__android_stl lang)
+ __android_stl_cxx(${lang} libc++_shared.so)
+endmacro()
diff --git a/Modules/Platform/Android/ndk-stl-c++_static.cmake b/Modules/Platform/Android/ndk-stl-c++_static.cmake
new file mode 100644
index 0000000..8e562f8
--- /dev/null
+++ b/Modules/Platform/Android/ndk-stl-c++_static.cmake
@@ -0,0 +1,6 @@
+include(Platform/Android/ndk-stl-c++)
+macro(__android_stl lang)
+ __android_stl_cxx(${lang} libc++_static.a)
+ __android_stl_lib(${lang} "${CMAKE_ANDROID_NDK}/sources/cxx-stl/llvm-libc++/libs/${CMAKE_ANDROID_ARCH_ABI}/libc++abi.a" 0)
+ __android_stl_lib(${lang} "${CMAKE_ANDROID_NDK}/sources/cxx-stl/llvm-libc++/libs/${CMAKE_ANDROID_ARCH_ABI}/libandroid_support.a" 0)
+endmacro()
diff --git a/Modules/Platform/Android/ndk-stl-gabi++.cmake b/Modules/Platform/Android/ndk-stl-gabi++.cmake
new file mode 100644
index 0000000..850a47a
--- /dev/null
+++ b/Modules/Platform/Android/ndk-stl-gabi++.cmake
@@ -0,0 +1,7 @@
+# <ndk>/sources/cxx-stl/gabi++/Android.mk
+set(_ANDROID_STL_RTTI 1)
+set(_ANDROID_STL_EXCEPTIONS 1)
+macro(__android_stl_gabixx lang filename)
+ __android_stl_inc(${lang} "${CMAKE_ANDROID_NDK}/sources/cxx-stl/gabi++/include" 1)
+ __android_stl_lib(${lang} "${CMAKE_ANDROID_NDK}/sources/cxx-stl/gabi++/libs/${CMAKE_ANDROID_ARCH_ABI}/${filename}" 1)
+endmacro()
diff --git a/Modules/Platform/Android/ndk-stl-gabi++_shared.cmake b/Modules/Platform/Android/ndk-stl-gabi++_shared.cmake
new file mode 100644
index 0000000..314c1e0
--- /dev/null
+++ b/Modules/Platform/Android/ndk-stl-gabi++_shared.cmake
@@ -0,0 +1,4 @@
+include(Platform/Android/ndk-stl-gabi++)
+macro(__android_stl lang)
+ __android_stl_gabixx(${lang} libgabi++_shared.so)
+endmacro()
diff --git a/Modules/Platform/Android/ndk-stl-gabi++_static.cmake b/Modules/Platform/Android/ndk-stl-gabi++_static.cmake
new file mode 100644
index 0000000..f4a1d3c
--- /dev/null
+++ b/Modules/Platform/Android/ndk-stl-gabi++_static.cmake
@@ -0,0 +1,4 @@
+include(Platform/Android/ndk-stl-gabi++)
+macro(__android_stl lang)
+ __android_stl_gabixx(${lang} libgabi++_static.a)
+endmacro()
diff --git a/Modules/Platform/Android/ndk-stl-gnustl.cmake b/Modules/Platform/Android/ndk-stl-gnustl.cmake
new file mode 100644
index 0000000..b3226ee
--- /dev/null
+++ b/Modules/Platform/Android/ndk-stl-gnustl.cmake
@@ -0,0 +1,9 @@
+# <ndk>/sources/cxx-stl/gnu-libstdc++/Android.mk
+set(_ANDROID_STL_RTTI 1)
+set(_ANDROID_STL_EXCEPTIONS 1)
+macro(__android_stl_gnustl lang filename)
+ __android_stl_inc(${lang} "${CMAKE_ANDROID_NDK}/sources/cxx-stl/gnu-libstdc++/${CMAKE_${lang}_ANDROID_TOOLCHAIN_VERSION}/include" 1)
+ __android_stl_inc(${lang} "${CMAKE_ANDROID_NDK}/sources/cxx-stl/gnu-libstdc++/${CMAKE_${lang}_ANDROID_TOOLCHAIN_VERSION}/libs/${CMAKE_ANDROID_ARCH_ABI}/include" 1)
+ __android_stl_inc(${lang} "${CMAKE_ANDROID_NDK}/sources/cxx-stl/gnu-libstdc++/${CMAKE_${lang}_ANDROID_TOOLCHAIN_VERSION}/include/backward" 1)
+ __android_stl_lib(${lang} "${CMAKE_ANDROID_NDK}/sources/cxx-stl/gnu-libstdc++/${CMAKE_${lang}_ANDROID_TOOLCHAIN_VERSION}/libs/${CMAKE_ANDROID_ARCH_ABI}/${filename}" 1)
+endmacro()
diff --git a/Modules/Platform/Android/ndk-stl-gnustl_shared.cmake b/Modules/Platform/Android/ndk-stl-gnustl_shared.cmake
new file mode 100644
index 0000000..f20cc4d
--- /dev/null
+++ b/Modules/Platform/Android/ndk-stl-gnustl_shared.cmake
@@ -0,0 +1,4 @@
+include(Platform/Android/ndk-stl-gnustl)
+macro(__android_stl lang)
+ __android_stl_gnustl(${lang} libgnustl_shared.so)
+endmacro()
diff --git a/Modules/Platform/Android/ndk-stl-gnustl_static.cmake b/Modules/Platform/Android/ndk-stl-gnustl_static.cmake
new file mode 100644
index 0000000..af4cc2a
--- /dev/null
+++ b/Modules/Platform/Android/ndk-stl-gnustl_static.cmake
@@ -0,0 +1,4 @@
+include(Platform/Android/ndk-stl-gnustl)
+macro(__android_stl lang)
+ __android_stl_gnustl(${lang} libgnustl_static.a)
+endmacro()
diff --git a/Modules/Platform/Android/ndk-stl-none.cmake b/Modules/Platform/Android/ndk-stl-none.cmake
new file mode 100644
index 0000000..9049c91
--- /dev/null
+++ b/Modules/Platform/Android/ndk-stl-none.cmake
@@ -0,0 +1,2 @@
+macro(__android_stl lang)
+endmacro()
diff --git a/Modules/Platform/Android/ndk-stl-stlport.cmake b/Modules/Platform/Android/ndk-stl-stlport.cmake
new file mode 100644
index 0000000..eab6b94
--- /dev/null
+++ b/Modules/Platform/Android/ndk-stl-stlport.cmake
@@ -0,0 +1,7 @@
+# <ndk>/sources/cxx-stl/stlport/Android.mk
+set(_ANDROID_STL_RTTI 1)
+set(_ANDROID_STL_EXCEPTIONS 1)
+macro(__android_stl_stlport lang filename)
+ __android_stl_inc(${lang} "${CMAKE_ANDROID_NDK}/sources/cxx-stl/stlport/stlport" 1)
+ __android_stl_lib(${lang} "${CMAKE_ANDROID_NDK}/sources/cxx-stl/stlport/libs/${CMAKE_ANDROID_ARCH_ABI}/${filename}" 1)
+endmacro()
diff --git a/Modules/Platform/Android/ndk-stl-stlport_shared.cmake b/Modules/Platform/Android/ndk-stl-stlport_shared.cmake
new file mode 100644
index 0000000..2b5846b
--- /dev/null
+++ b/Modules/Platform/Android/ndk-stl-stlport_shared.cmake
@@ -0,0 +1,4 @@
+include(Platform/Android/ndk-stl-stlport)
+macro(__android_stl lang)
+ __android_stl_stlport(${lang} libstlport_shared.so)
+endmacro()
diff --git a/Modules/Platform/Android/ndk-stl-stlport_static.cmake b/Modules/Platform/Android/ndk-stl-stlport_static.cmake
new file mode 100644
index 0000000..bf60307
--- /dev/null
+++ b/Modules/Platform/Android/ndk-stl-stlport_static.cmake
@@ -0,0 +1,4 @@
+include(Platform/Android/ndk-stl-stlport)
+macro(__android_stl lang)
+ __android_stl_stlport(${lang} libstlport_static.a)
+endmacro()
diff --git a/Modules/Platform/Android/ndk-stl-system.cmake b/Modules/Platform/Android/ndk-stl-system.cmake
new file mode 100644
index 0000000..dd554fe
--- /dev/null
+++ b/Modules/Platform/Android/ndk-stl-system.cmake
@@ -0,0 +1,6 @@
+# <ndk>/android-ndk-r11c/sources/cxx-stl/system/Android.mk
+set(_ANDROID_STL_RTTI 0)
+set(_ANDROID_STL_EXCEPTIONS 0)
+macro(__android_stl lang)
+ __android_stl_inc(${lang} "${CMAKE_ANDROID_NDK}/sources/cxx-stl/system/include" 1)
+endmacro()