danvratil / qcoro

C++ Coroutines for Qt
https://qcoro.dvratil.cz
MIT License
326 stars 53 forks source link

Suppress Clang error when building against Android NDK <= 25 #205

Closed danvratil closed 8 months ago

danvratil commented 8 months ago

Android NDK <= 25 ships mismatching version of clang and libc++. The libc++ in the NDK is old and doesn't support coroutines, which forces us to fallback to using coroutines from std::experimental namespace. However, the clang version is newer and causes a compile error when using coroutines from std::experimental, because as of LLVM 14, coroutines are fully implemented.

To suppresss the error, we must set a special compile option. This is fixed with NDK 26, which now ships libc++ from LLVM toolchain, so the version matches the compiler version (and they updated to LLVM 17 with full coroutine support).

Resolves issue #204.