我对 log4cplus 中的 Android 支持有疑问。我可以在 MSVC 以及 Ubuntu 上的 GCC 和 Clang 中使用 std::source_location
。但是 Android NDK 虽然使用 Clang 14,但似乎缺少它。在 CMake Android 构建中是否有一些变量可以用来启用它或符合 C++20 的标准 C++ 库?有关 GitHub 操作描述符,请参阅https://github.com/wilx/log4cplus/actions/runs/4213340922/workflow。
Libc++ 仅支持 std::source_location
从 LLVM/Clang 版本 16 开始,参见 https://libcxx.llvm.org/Status/Cxx20.html,据我所知这意味着目前没有 Android NDK 支持它。
在 Ubuntu 上,您可能正在使用带有 Clang 的 libstdc++,这是标准库(GCC 的一部分)的单独实现。