mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2026-10-19 09:08:59 +02:00
CMakeLists: Add -fexperimental-library to allow use of std::jthread with libc++ 18.
This commit is contained in:
1 parent
5bcd55eef5
commit
0f56e58742
1 file changed
+13
@@ -19,6 +19,19 @@ if (NOT MSVC)
|
||||
set(CMAKE_CXX_STANDARD 23)
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
set(CMAKE_CXX_EXTENSIONS OFF)
|
||||
|
||||
# std::jthread is guarded behind -fexperimental-library prior to libc++ version 20
|
||||
check_cxx_source_compiles([[
|
||||
#include <version>
|
||||
#if defined(_LIBCPP_VERSION) && _LIBCPP_VERSION < 200000
|
||||
#error libc++ version < 20
|
||||
#endif
|
||||
int main() {}
|
||||
]] IS_JTHREAD_STABLE)
|
||||
|
||||
if(NOT IS_JTHREAD_STABLE)
|
||||
add_compile_options(-fexperimental-library)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
|
||||
|
||||
Reference in new issue
Block a user