diff options
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/Platform/Android-Clang-CXX.cmake | 7 | ||||
-rw-r--r-- | Modules/Platform/Android-GNU-CXX.cmake | 3 | ||||
-rw-r--r-- | Modules/Platform/Android/ndk-stl-c++.cmake | 1 | ||||
-rw-r--r-- | Modules/Platform/Android/ndk-stl-gabi++.cmake | 1 | ||||
-rw-r--r-- | Modules/Platform/Android/ndk-stl-gnustl.cmake | 1 | ||||
-rw-r--r-- | Modules/Platform/Android/ndk-stl-none.cmake | 1 | ||||
-rw-r--r-- | Modules/Platform/Android/ndk-stl-stlport.cmake | 1 | ||||
-rw-r--r-- | Modules/Platform/Android/ndk-stl-system.cmake | 1 |
8 files changed, 16 insertions, 0 deletions
diff --git a/Modules/Platform/Android-Clang-CXX.cmake b/Modules/Platform/Android-Clang-CXX.cmake index 7111836..85d5088 100644 --- a/Modules/Platform/Android-Clang-CXX.cmake +++ b/Modules/Platform/Android-Clang-CXX.cmake @@ -1,2 +1,9 @@ include(Platform/Android-Clang) __android_compiler_clang(CXX) +if(_ANDROID_STL_NOSTDLIBXX) + if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 6) + string(APPEND CMAKE_CXX_STANDARD_LIBRARIES " -nostdlib++") + else() + string(APPEND CMAKE_CXX_STANDARD_LIBRARIES " -nodefaultlibs -lgcc -lc -lm -ldl") + endif() +endif() diff --git a/Modules/Platform/Android-GNU-CXX.cmake b/Modules/Platform/Android-GNU-CXX.cmake index 41279d1..d30d0ff 100644 --- a/Modules/Platform/Android-GNU-CXX.cmake +++ b/Modules/Platform/Android-GNU-CXX.cmake @@ -1,2 +1,5 @@ include(Platform/Android-GNU) __android_compiler_gnu(CXX) +if(_ANDROID_STL_NOSTDLIBXX) + string(APPEND CMAKE_CXX_STANDARD_LIBRARIES " -nodefaultlibs -lgcc -lc -lm -ldl") +endif() diff --git a/Modules/Platform/Android/ndk-stl-c++.cmake b/Modules/Platform/Android/ndk-stl-c++.cmake index a12411c..1cafd1f 100644 --- a/Modules/Platform/Android/ndk-stl-c++.cmake +++ b/Modules/Platform/Android/ndk-stl-c++.cmake @@ -1,6 +1,7 @@ # <ndk>/sources/cxx-stl/llvm-libc++/Android.mk set(_ANDROID_STL_RTTI 1) set(_ANDROID_STL_EXCEPTIONS 1) +set(_ANDROID_STL_NOSTDLIBXX 1) macro(__android_stl_cxx lang filename) # Add the include directory. if(EXISTS "${CMAKE_ANDROID_NDK}/sources/cxx-stl/llvm-libc++/libcxx/include/cstddef") diff --git a/Modules/Platform/Android/ndk-stl-gabi++.cmake b/Modules/Platform/Android/ndk-stl-gabi++.cmake index 850a47a..d3b9e45 100644 --- a/Modules/Platform/Android/ndk-stl-gabi++.cmake +++ b/Modules/Platform/Android/ndk-stl-gabi++.cmake @@ -1,6 +1,7 @@ # <ndk>/sources/cxx-stl/gabi++/Android.mk set(_ANDROID_STL_RTTI 1) set(_ANDROID_STL_EXCEPTIONS 1) +set(_ANDROID_STL_NOSTDLIBXX 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) diff --git a/Modules/Platform/Android/ndk-stl-gnustl.cmake b/Modules/Platform/Android/ndk-stl-gnustl.cmake index b3226ee..46cedc6 100644 --- a/Modules/Platform/Android/ndk-stl-gnustl.cmake +++ b/Modules/Platform/Android/ndk-stl-gnustl.cmake @@ -1,6 +1,7 @@ # <ndk>/sources/cxx-stl/gnu-libstdc++/Android.mk set(_ANDROID_STL_RTTI 1) set(_ANDROID_STL_EXCEPTIONS 1) +set(_ANDROID_STL_NOSTDLIBXX 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) diff --git a/Modules/Platform/Android/ndk-stl-none.cmake b/Modules/Platform/Android/ndk-stl-none.cmake index 9049c91..45122f7 100644 --- a/Modules/Platform/Android/ndk-stl-none.cmake +++ b/Modules/Platform/Android/ndk-stl-none.cmake @@ -1,2 +1,3 @@ +set(_ANDROID_STL_NOSTDLIBXX 1) macro(__android_stl lang) endmacro() diff --git a/Modules/Platform/Android/ndk-stl-stlport.cmake b/Modules/Platform/Android/ndk-stl-stlport.cmake index eab6b94..efad33b 100644 --- a/Modules/Platform/Android/ndk-stl-stlport.cmake +++ b/Modules/Platform/Android/ndk-stl-stlport.cmake @@ -1,6 +1,7 @@ # <ndk>/sources/cxx-stl/stlport/Android.mk set(_ANDROID_STL_RTTI 1) set(_ANDROID_STL_EXCEPTIONS 1) +set(_ANDROID_STL_NOSTDLIBXX 0) 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) diff --git a/Modules/Platform/Android/ndk-stl-system.cmake b/Modules/Platform/Android/ndk-stl-system.cmake index dd554fe..7d86a40 100644 --- a/Modules/Platform/Android/ndk-stl-system.cmake +++ b/Modules/Platform/Android/ndk-stl-system.cmake @@ -1,6 +1,7 @@ # <ndk>/android-ndk-r11c/sources/cxx-stl/system/Android.mk set(_ANDROID_STL_RTTI 0) set(_ANDROID_STL_EXCEPTIONS 0) +set(_ANDROID_STL_NOSTDLIBXX 0) macro(__android_stl lang) __android_stl_inc(${lang} "${CMAKE_ANDROID_NDK}/sources/cxx-stl/system/include" 1) endmacro() |