Android: Passing sysroot /usr/include to include_directories breaks ordering
When cross-compiling to Android, the code
include_directories(${CMAKE_SYSROOT_COMPILE}/usr/include)
causes the -isystem /path/to/sysroot/usr/include
argument that CMake adds to move too early in the command line. This directory is listed in CMAKE_${lang}_STANDARD_INCLUDE_DIRECTORIES
and therefore should be added only at the end of the command line. It should be filtered out of user-specified directories because it is an implicit include directory.
This was discovered by discussion in Android NDK issue 452.