CMake/Modules/Platform/Android-Clang-CXX.cmake
Brad King 843d55de29 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>
2018-04-03 14:34:57 -04:00

10 lines
322 B
CMake

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()