summaryrefslogtreecommitdiffstats
path: root/Modules/Platform/Android/ndk-stl-c++.cmake
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/ndk-stl-c++.cmake
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/ndk-stl-c++.cmake')
-rw-r--r--Modules/Platform/Android/ndk-stl-c++.cmake13
1 files changed, 13 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()