From e0d28bcc0b94e1923228767719b09fc28ad99604 Mon Sep 17 00:00:00 2001 From: Aaron Colwell <300262+acolwell@users.noreply.github.com> Date: Mon, 23 Dec 2024 10:56:28 -0800 Subject: [PATCH] Fix 'unknown warning option' warnings when building with Clang (#1028) Fixes #1027 --- CMakeLists.txt | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 9aa47f144..48dd73e22 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -119,9 +119,10 @@ if (MSVC) else() SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wmissing-prototypes" ) add_compile_options(-Wall -Wextra -Wmissing-declarations -Wno-multichar -Winit-self -Wno-long-long - -Wvla -Wdate-time -Wshift-overflow=2 - -Wduplicated-cond -Wno-stringop-overflow -Wno-format-overflow - -Wno-deprecated-copy) + -Wvla -Wdate-time -Wno-format-overflow -Wno-deprecated-copy) + if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU") + add_compile_options(-Wshift-overflow=2 -Wduplicated-cond -Wno-stringop-overflow) + endif() endif() if(NATRON_SYSTEM_LIBS) @@ -141,7 +142,10 @@ elseif(WIN32) add_compile_definitions(WINDOWS WIN32 _UNICODE UNICODE NOMINMAX QHTTP_SERVER_STATIC) add_compile_definitions(COMPILED_FROM_DSP XML_STATIC) # for expat if (NOT MSVC) - add_compile_options(-mwindows -municode -mthreads) + add_compile_options(-municode) + if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU") + add_compile_options(-mwindows -mthreads) + endif() add_link_options(-mwindows -municode) set(CMAKE_RC_COMPILER_INIT windres) set(CMAKE_RC_COMPILE_OBJECT