Files
CMake/Tests/RunCMake/Android/check_binary.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

9 lines
319 B
CMake

if(NOT EXISTS "${file}")
message(FATAL_ERROR "Missing file:\n ${file}")
endif()
execute_process(COMMAND "${objdump}" -p ${file} OUTPUT_VARIABLE out)
if(out MATCHES "NEEDED[^\n]*stdc\\+\\+")
string(REPLACE "\n" "\n " out " ${out}")
message(FATAL_ERROR "File:\n ${file}\ndepends on libstdc++:\n${out}")
endif()