Android 32-bit compilation broken for standalone toolchain with unified headers
Using a standalone toolchain built from NDK-r14b using --arch arm --api 21 --stl libc++ --unified-headers
and a toolchain file that makes use of CMakes Android platform support, compilation is broken.
Specifically, cmath reports a number of undefined symbols including abs, isdigit, and several others due to the order of the system search paths being incorrect. ${SYSROOT}/usr/include
must come after ${TOOLCHAIN}/include/c++/...
The offending line appears to be Android-Common.cmake:159
, where it adds ${CMAKE_SYSROOT}/usr/include
to CMAKE_CXX_STANDARD_INCLUDE_DIRECTORIES
. Removing this line resolves the problem, as does preemptively setting CMAKE_CXX_STANDARD_INCLUDE_DIRECTORIES
to ${CMAKE_SYSROOT}/include/c++/4.9.0
Edited by Brad King