mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-06 05:40:54 -06:00
Android: Suppress implicit -lstdc++ linker flag
The chosen STL libraries are already linked explicitly so we shouldn't let the compiler add its implicit `-lstdc++` (the default) when invoking the linker. Fixes: #17863 NDK-Issue: https://github.com/android-ndk/ndk/issues/105 Inspired-by: Tom Hughes <tomtheengineer@gmail.com>
This commit is contained in:
@@ -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")
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -1,2 +1,3 @@
|
||||
set(_ANDROID_STL_NOSTDLIBXX 1)
|
||||
macro(__android_stl lang)
|
||||
endmacro()
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user