diff --git a/reactos/dll/3rdparty/libtiff/CMakeLists.txt b/reactos/dll/3rdparty/libtiff/CMakeLists.txt index 27ec6ad2bb5..6ea7bb06e29 100644 --- a/reactos/dll/3rdparty/libtiff/CMakeLists.txt +++ b/reactos/dll/3rdparty/libtiff/CMakeLists.txt @@ -61,5 +61,7 @@ add_cd_file(TARGET libtiff DESTINATION reactos/system32 FOR all) if(NOT MSVC) allow_warnings(libtiff) - add_target_compile_flags(libtiff "-Wno-unused-but-set-variable") + if(NOT CMAKE_C_COMPILER_ID STREQUAL "Clang") + add_target_compile_flags(libtiff "-Wno-unused-but-set-variable") + endif() endif() diff --git a/reactos/dll/3rdparty/libxslt/CMakeLists.txt b/reactos/dll/3rdparty/libxslt/CMakeLists.txt index 988a7ca3c29..648ca8d4a62 100644 --- a/reactos/dll/3rdparty/libxslt/CMakeLists.txt +++ b/reactos/dll/3rdparty/libxslt/CMakeLists.txt @@ -48,5 +48,8 @@ add_pch(libxslt precomp.h SOURCE) add_cd_file(TARGET libxslt DESTINATION reactos/system32 FOR all) if(NOT MSVC) - add_target_compile_flags(libxslt "-Wno-pointer-sign -Wno-unused-but-set-variable -Wno-unused-function") + add_target_compile_flags(libxslt "-Wno-pointer-sign -Wno-unused-function") + if(NOT CMAKE_C_COMPILER_ID STREQUAL "Clang") + add_target_compile_flags(libxslt "-Wno-unused-but-set-variable") + endif() endif() diff --git a/reactos/dll/opengl/glu32/CMakeLists.txt b/reactos/dll/opengl/glu32/CMakeLists.txt index 4c15d12325e..34471408c8f 100644 --- a/reactos/dll/opengl/glu32/CMakeLists.txt +++ b/reactos/dll/opengl/glu32/CMakeLists.txt @@ -113,11 +113,13 @@ add_library(glu32 SHARED ${SOURCE} glu32.rc) set_module_type(glu32 win32dll) if(NOT MSVC) - add_target_compile_flags(glu32 "-Wno-write-strings -Wno-unused-but-set-variable") + add_target_compile_flags(glu32 "-Wno-write-strings") if(CMAKE_C_COMPILER_ID STREQUAL "Clang") target_link_libraries(glu32 mingwex) #FIXME: longjmp exists in both our msvcrt and mingwex add_target_link_flags(glu32 "-Wl,--allow-multiple-definition") + else() + add_target_compile_flags(glu32 "-Wno-unused-but-set-variable") endif() endif() diff --git a/reactos/dll/win32/browseui/CMakeLists.txt b/reactos/dll/win32/browseui/CMakeLists.txt index e5f39bc01d3..2c1e04c067c 100644 --- a/reactos/dll/win32/browseui/CMakeLists.txt +++ b/reactos/dll/win32/browseui/CMakeLists.txt @@ -60,7 +60,9 @@ add_pch(browseui precomp.h SOURCE) add_cd_file(TARGET browseui DESTINATION reactos/system32 FOR all) if(NOT MSVC) - add_target_compile_flags(browseui "-Wno-unused-but-set-variable") + if(NOT CMAKE_C_COMPILER_ID STREQUAL "Clang") + add_target_compile_flags(browseui "-Wno-unused-but-set-variable") + endif() # Binutils linker bug if(LTCG) diff --git a/reactos/dll/win32/winmm/CMakeLists.txt b/reactos/dll/win32/winmm/CMakeLists.txt index 6123003f1ca..0c59c51db63 100644 --- a/reactos/dll/win32/winmm/CMakeLists.txt +++ b/reactos/dll/win32/winmm/CMakeLists.txt @@ -29,6 +29,6 @@ add_pch(winmm winemm.h SOURCE) add_subdirectory(midimap) add_cd_file(TARGET winmm DESTINATION reactos/system32 FOR all) -if(NOT MSVC) +if((NOT MSVC) AND (NOT CMAKE_C_COMPILER_ID STREQUAL "Clang")) add_target_compile_flags(winmm "-Wno-unused-but-set-variable") endif() diff --git a/reactos/drivers/bluetooth/fbtusb/CMakeLists.txt b/reactos/drivers/bluetooth/fbtusb/CMakeLists.txt index 5b8288f5c12..f3f9d190a53 100644 --- a/reactos/drivers/bluetooth/fbtusb/CMakeLists.txt +++ b/reactos/drivers/bluetooth/fbtusb/CMakeLists.txt @@ -12,8 +12,8 @@ list(APPEND SOURCE add_library(fbtusb SHARED ${SOURCE} fbtusb.rc) -if(NOT MSVC) - set_source_files_properties(${SOURCE} PROPERTIES COMPILE_FLAGS "-Wno-unused-but-set-variable") +if((NOT MSVC) AND (NOT CMAKE_C_COMPILER_ID STREQUAL "Clang")) + add_target_compile_flags(fbtusb "-Wno-unused-but-set-variable") endif() set_module_type(fbtusb kernelmodedriver) diff --git a/reactos/drivers/filesystems/ext2/CMakeLists.txt b/reactos/drivers/filesystems/ext2/CMakeLists.txt index afb66a6a2ed..8e1f9529efe 100644 --- a/reactos/drivers/filesystems/ext2/CMakeLists.txt +++ b/reactos/drivers/filesystems/ext2/CMakeLists.txt @@ -24,8 +24,8 @@ list(APPEND SOURCE add_library(ext2fs SHARED ${SOURCE}) -if(NOT MSVC) - add_compile_flags("-Wno-unused-but-set-variable") +if((NOT MSVC) AND (NOT CMAKE_C_COMPILER_ID STREQUAL "Clang")) + add_target_compile_flags(ext2fs "-Wno-unused-but-set-variable") endif() target_link_libraries(ext2fs ${PSEH_LIB}) diff --git a/reactos/drivers/storage/ide/uniata/CMakeLists.txt b/reactos/drivers/storage/ide/uniata/CMakeLists.txt index 2236e470c05..922d18e7a11 100644 --- a/reactos/drivers/storage/ide/uniata/CMakeLists.txt +++ b/reactos/drivers/storage/ide/uniata/CMakeLists.txt @@ -22,7 +22,10 @@ add_library(uniata SHARED ${SOURCE} idedma.rc) if(NOT MSVC) - set_source_files_properties(${SOURCE} PROPERTIES COMPILE_FLAGS "-Wno-unused-but-set-variable -Wno-narrowing") + add_target_compile_flags(uniata "-Wno-narrowing") + if(NOT CMAKE_C_COMPILER_ID STREQUAL "Clang") + add_target_compile_flags(uniata "-Wno-unused-but-set-variable") + endif() endif() add_pch(uniata stdafx.h SOURCE) diff --git a/reactos/lib/3rdparty/adns/CMakeLists.txt b/reactos/lib/3rdparty/adns/CMakeLists.txt index e85e7070537..b8187d8fd17 100644 --- a/reactos/lib/3rdparty/adns/CMakeLists.txt +++ b/reactos/lib/3rdparty/adns/CMakeLists.txt @@ -25,6 +25,6 @@ add_library(adns ${SOURCE}) add_dependencies(adns psdk) add_pch(adns src/internal.h SOURCE) -if(NOT MSVC) +if((NOT MSVC) AND (NOT CMAKE_C_COMPILER_ID STREQUAL "Clang")) add_target_compile_flags(adns "-Wno-unused-but-set-variable") endif() diff --git a/reactos/lib/3rdparty/cardlib/CMakeLists.txt b/reactos/lib/3rdparty/cardlib/CMakeLists.txt index 8369f57d970..d624197436a 100644 --- a/reactos/lib/3rdparty/cardlib/CMakeLists.txt +++ b/reactos/lib/3rdparty/cardlib/CMakeLists.txt @@ -19,6 +19,6 @@ add_library(cardlib ${SOURCE}) add_dependencies(cardlib psdk) add_pch(cardlib cardlib.h SOURCE) -if(NOT MSVC AND (NOT CMAKE_C_COMPILER_ID STREQUAL "Clang")) +if((NOT MSVC) AND (NOT CMAKE_C_COMPILER_ID STREQUAL "Clang")) add_target_compile_flags(cardlib "-Wno-unused-but-set-variable") endif() diff --git a/reactos/lib/3rdparty/fullfat/CMakeLists.txt b/reactos/lib/3rdparty/fullfat/CMakeLists.txt index 6163ff51e23..ec426f1f688 100644 --- a/reactos/lib/3rdparty/fullfat/CMakeLists.txt +++ b/reactos/lib/3rdparty/fullfat/CMakeLists.txt @@ -19,6 +19,6 @@ list(APPEND SOURCE add_library(fullfat ${SOURCE}) add_dependencies(fullfat bugcodes) -if(NOT MSVC) +if((NOT MSVC) AND (NOT CMAKE_C_COMPILER_ID STREQUAL "Clang")) add_target_compile_flags(fullfat "-Wno-unused-but-set-variable") endif() diff --git a/reactos/lib/3rdparty/libmpg123/CMakeLists.txt b/reactos/lib/3rdparty/libmpg123/CMakeLists.txt index 3731927f62e..954682f000a 100644 --- a/reactos/lib/3rdparty/libmpg123/CMakeLists.txt +++ b/reactos/lib/3rdparty/libmpg123/CMakeLists.txt @@ -45,6 +45,6 @@ add_library(libmpg123 ${SOURCE}) add_dependencies(libmpg123 psdk) add_pch(libmpg123 precomp.h SOURCE) -if(NOT MSVC) +if((NOT MSVC) AND (NOT CMAKE_C_COMPILER_ID STREQUAL "Clang")) add_target_compile_flags(libmpg123 "-Wno-unused-but-set-variable") endif()