mirror of https://github.com/c-ares/c-ares.git
cmake: Android requires C99 (#748)
I tried to build c-ares using CMake with the latest Android NDK (r26/27), but failed as follows. ``` Building C object _deps/c-ares-source-build/src/lib/CMakeFiles/c-ares.dir/Debug/ares__buf.c.o FAILED: _deps/c-ares-source-build/src/lib/CMakeFiles/c-ares.dir/Debug/ares__buf.c.o In file included from c-ares/src/lib/ares__buf.c:27: In file included from c-ares/include/ares.h:85: In file included from Android/sdk/ndk/27.0.11718014/toolchains/llvm/prebuilt/darwin-x86_64/sysroot/usr/include/netinet/in.h:36: In file included from Android/sdk/ndk/27.0.11718014/toolchains/llvm/prebuilt/darwin-x86_64/sysroot/usr/include/linux/in.h:231: In file included from Android/sdk/ndk/27.0.11718014/toolchains/llvm/prebuilt/darwin-x86_64/sysroot/usr/include/aarch64-linux-android/asm/byteorder.h:12: In file included from Android/sdk/ndk/27.0.11718014/toolchains/llvm/prebuilt/darwin-x86_64/sysroot/usr/include/linux/byteorder/little_endian.h:17: Android/sdk/ndk/27.0.11718014/toolchains/llvm/prebuilt/darwin-x86_64/sysroot/usr/include/linux/swab.h:28:8: error: unknown type name 'inline' 28 | static inline __attribute__((__const__)) __u32 __fswahw32(__u32 val) { | ^ Android/sdk/ndk/27.0.11718014/toolchains/llvm/prebuilt/darwin-x86_64/sysroot/usr/include/linux/swab.h:28:47: error: expected ';' after top level declarator 28 | static inline __attribute__((__const__)) __u32 __fswahw32(__u32 val) { | ^ ``` It looks like the NDK recently added C99 code containing `inline` functions, but c-ares is setting the `C_STANDARD` CMake property to C90. Fix By: Jiwoo Park (@jimmy-park)pull/744/head
parent
ebb0a631ef
commit
668a9efdd8
2 changed files with 16 additions and 0 deletions
Loading…
Reference in new issue