From b9de2b0bf8588bd22ed00d9f4a9c72d1457e66ff Mon Sep 17 00:00:00 2001 From: Andrew Johnson Date: Mon, 1 Jul 2024 21:39:32 +0300 Subject: [PATCH] Ignore maybe-uninitialised on MacOS with GCC >= 11 --- CMakeLists.txt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 2d184e4..373bb1f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -53,6 +53,12 @@ if(MSVC) xcheck_add_c_compiler_flag(/experimental:c11atomics) 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") add_compile_definitions( _WASI_EMULATED_PROCESS_CLOCKS