Ignore maybe-uninitialised on MacOS with GCC >= 11

This commit is contained in:
Andrew Johnson 2024-07-01 21:39:32 +03:00 committed by Saúl Ibarra Corretgé
parent e8ef9d6072
commit b9de2b0bf8

View file

@ -53,6 +53,12 @@ if(MSVC)
xcheck_add_c_compiler_flag(/experimental:c11atomics) xcheck_add_c_compiler_flag(/experimental:c11atomics)
endif() endif()
# MacOS and GCC 11 or later need -Wno-maybe-uninitialized
# https://github.com/quickjs-ng/quickjs/issues/453
if(APPLE AND CMAKE_C_COMPILER_ID STREQUAL "GNU" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 11)
xcheck_add_c_compiler_flag(-Wno-maybe-uninitialized)
endif()
if(CMAKE_SYSTEM_NAME STREQUAL "WASI") if(CMAKE_SYSTEM_NAME STREQUAL "WASI")
add_compile_definitions( add_compile_definitions(
_WASI_EMULATED_PROCESS_CLOCKS _WASI_EMULATED_PROCESS_CLOCKS