https://git.reactos.org/?p=reactos.git;a=commitdiff;h=00124d1b1ad0ff51d6ce1…
commit 00124d1b1ad0ff51d6ce1eb868ecb57aca481cdd
Author: Amine Khaldi <amine.khaldi(a)reactos.org>
AuthorDate: Sun Dec 3 23:30:10 2017 +0100
[CMAKE/CLANG-CL] Silence some clang-cl warnings in consistency with our gcc build.
---
base/services/nfsd/CMakeLists.txt | 2 +-
dll/3rdparty/libtiff/CMakeLists.txt | 4 +---
dll/3rdparty/libtirpc/CMakeLists.txt | 2 +-
dll/3rdparty/libxslt/CMakeLists.txt | 5 +----
dll/3rdparty/mbedtls/CMakeLists.txt | 5 ++---
dll/opengl/glu32/CMakeLists.txt | 3 +++
dll/opengl/mesa/main/CMakeLists.txt | 3 +++
dll/opengl/mesa/swrast/CMakeLists.txt | 5 ++++-
drivers/bluetooth/fbtusb/CMakeLists.txt | 2 +-
drivers/filesystems/ext2/CMakeLists.txt | 17 ++++++++++++-----
drivers/filesystems/ffs/CMakeLists.txt | 11 ++++++-----
drivers/filesystems/nfs/CMakeLists.txt | 5 ++++-
drivers/filesystems/reiserfs/CMakeLists.txt | 9 +++++----
drivers/filesystems/udfs/CMakeLists.txt | 8 ++++++++
drivers/storage/class/cdrom_new/CMakeLists.txt | 9 +++++----
drivers/storage/class/disk_new/CMakeLists.txt | 6 ++----
drivers/storage/ide/uniata/CMakeLists.txt | 6 ++++--
drivers/wdm/audio/drivers/CMIDriver/CMakeLists.txt | 6 ++----
modules/rostests/winetests/advapi32/CMakeLists.txt | 2 +-
modules/rostests/winetests/comctl32/CMakeLists.txt | 11 +++++------
modules/rostests/winetests/kernel32/CMakeLists.txt | 2 +-
modules/rostests/winetests/msvcrt/CMakeLists.txt | 7 +++++--
modules/rostests/winetests/ntdll/CMakeLists.txt | 9 +++++----
modules/rostests/winetests/rpcrt4/CMakeLists.txt | 12 ++++++++----
modules/rostests/winetests/winmm/CMakeLists.txt | 12 +++++-------
modules/rostests/winetests/ws2_32/CMakeLists.txt | 9 +++++----
sdk/lib/3rdparty/adns/CMakeLists.txt | 7 ++++---
sdk/lib/3rdparty/cardlib/CMakeLists.txt | 7 ++++---
sdk/lib/3rdparty/libxml2/CMakeLists.txt | 9 +++++----
29 files changed, 113 insertions(+), 82 deletions(-)
diff --git a/base/services/nfsd/CMakeLists.txt b/base/services/nfsd/CMakeLists.txt
index 91ce1221b6..3ab680be23 100644
--- a/base/services/nfsd/CMakeLists.txt
+++ b/base/services/nfsd/CMakeLists.txt
@@ -48,7 +48,7 @@ list(APPEND SOURCE
add_executable(nfsd ${SOURCE} nfsd.rc)
-if(MSVC)
+if(MSVC AND (NOT USE_CLANG_CL))
else()
# FIXME: Tons of warnings.
add_target_compile_flags(nfsd "-w")
diff --git a/dll/3rdparty/libtiff/CMakeLists.txt b/dll/3rdparty/libtiff/CMakeLists.txt
index 5673ed9a97..9c57c2d1b3 100644
--- a/dll/3rdparty/libtiff/CMakeLists.txt
+++ b/dll/3rdparty/libtiff/CMakeLists.txt
@@ -59,7 +59,5 @@ add_pch(libtiff precomp.h SOURCE)
add_cd_file(TARGET libtiff DESTINATION reactos/system32 FOR all)
if(NOT MSVC)
- if(NOT CMAKE_C_COMPILER_ID STREQUAL "Clang")
- add_target_compile_flags(libtiff "-Wno-unused-but-set-variable")
- endif()
+ add_target_compile_flags(libtiff "-Wno-unused-but-set-variable")
endif()
diff --git a/dll/3rdparty/libtirpc/CMakeLists.txt b/dll/3rdparty/libtirpc/CMakeLists.txt
index f6c9f4c113..3d028925de 100644
--- a/dll/3rdparty/libtirpc/CMakeLists.txt
+++ b/dll/3rdparty/libtirpc/CMakeLists.txt
@@ -94,7 +94,7 @@ add_library(libtirpc SHARED
libtirpc/libtirpc_ros.rc
${CMAKE_CURRENT_BINARY_DIR}/libtirpc.def)
-if(MSVC)
+if(MSVC AND (NOT USE_CLANG_CL))
else()
# FIXME: Tons of warnings.
add_target_compile_flags(libtirpc "-w")
diff --git a/dll/3rdparty/libxslt/CMakeLists.txt b/dll/3rdparty/libxslt/CMakeLists.txt
index 1bace8f65b..07d927dbac 100644
--- a/dll/3rdparty/libxslt/CMakeLists.txt
+++ b/dll/3rdparty/libxslt/CMakeLists.txt
@@ -47,9 +47,6 @@ endif()
add_pch(libxslt precomp.h SOURCE)
add_cd_file(TARGET libxslt DESTINATION reactos/system32 FOR all)
-if(NOT MSVC)
+if(USE_CLANG_CL OR (NOT MSVC))
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/dll/3rdparty/mbedtls/CMakeLists.txt b/dll/3rdparty/mbedtls/CMakeLists.txt
index 0de5e350cc..c5af423712 100644
--- a/dll/3rdparty/mbedtls/CMakeLists.txt
+++ b/dll/3rdparty/mbedtls/CMakeLists.txt
@@ -95,7 +95,6 @@ add_cd_file(TARGET mbedtls DESTINATION reactos/system32 FOR all)
if(NOT MSVC)
add_target_compile_flags(mbedtls "-Wno-pointer-sign -Wno-unused-function")
- if(NOT CMAKE_C_COMPILER_ID STREQUAL "Clang")
- add_target_compile_flags(mbedtls "-Wno-unused-but-set-variable")
- endif()
+elseif(USE_CLANG_CL)
+ add_target_compile_flags(mbedtls "-Wno-tautological-constant-compare")
endif()
diff --git a/dll/opengl/glu32/CMakeLists.txt b/dll/opengl/glu32/CMakeLists.txt
index 9c8802c4e0..f9e0a4793c 100644
--- a/dll/opengl/glu32/CMakeLists.txt
+++ b/dll/opengl/glu32/CMakeLists.txt
@@ -121,6 +121,9 @@ set_module_type(glu32 win32dll)
if(NOT MSVC)
add_target_compile_flags(glu32 "-Wno-write-strings
-Wno-unused-but-set-variable")
+elseif(USE_CLANG_CL)
+ add_target_compile_flags(glu32 "-Wno-self-assign -Wno-unused-function
-Wno-microsoft-include")
+ add_target_compile_flags(glu32 "-Wno-deprecated-register
-Wno-tautological-undefined-compare")
endif()
add_importlibs(glu32 opengl32 gdi32 msvcrt kernel32 ntdll)
diff --git a/dll/opengl/mesa/main/CMakeLists.txt b/dll/opengl/mesa/main/CMakeLists.txt
index a0c6a4c3d0..bb93340fb4 100644
--- a/dll/opengl/mesa/main/CMakeLists.txt
+++ b/dll/opengl/mesa/main/CMakeLists.txt
@@ -75,4 +75,7 @@ add_pch(mesa_main precomp.h SOURCE)
if(NOT MSVC)
add_target_compile_flags(mesa_main "-Wno-type-limits")
+elseif(USE_CLANG_CL)
+ add_target_compile_flags(mesa_main "-Wno-cast-calling-convention
-Wno-unused-local-typedef")
+ add_target_compile_flags(mesa_main "-Wno-tautological-unsigned-zero-compare
-Wno-constant-conversion")
endif()
diff --git a/dll/opengl/mesa/swrast/CMakeLists.txt
b/dll/opengl/mesa/swrast/CMakeLists.txt
index 588c43df4c..32ae3fcd64 100644
--- a/dll/opengl/mesa/swrast/CMakeLists.txt
+++ b/dll/opengl/mesa/swrast/CMakeLists.txt
@@ -31,8 +31,11 @@ add_library(mesa_swrast STATIC ${SOURCE})
add_dependencies(mesa_swrast xdk)
add_pch(mesa_swrast precomp.h SOURCE)
-if(MSVC)
+if(MSVC AND (NOT USE_CLANG_CL))
replace_compile_flags("/we4189" " ")
else()
add_target_compile_flags(mesa_swrast "-Wno-unused-variable")
+ if(USE_CLANG_CL)
+ add_target_compile_flags(mesa_swrast "-Wno-sometimes-uninitialized
-Wno-unused-local-typedef")
+ endif()
endif()
diff --git a/drivers/bluetooth/fbtusb/CMakeLists.txt
b/drivers/bluetooth/fbtusb/CMakeLists.txt
index f3f9d190a5..b0e167a50e 100644
--- a/drivers/bluetooth/fbtusb/CMakeLists.txt
+++ b/drivers/bluetooth/fbtusb/CMakeLists.txt
@@ -12,7 +12,7 @@ list(APPEND SOURCE
add_library(fbtusb SHARED ${SOURCE} fbtusb.rc)
-if((NOT MSVC) AND (NOT CMAKE_C_COMPILER_ID STREQUAL "Clang"))
+if(NOT MSVC)
add_target_compile_flags(fbtusb "-Wno-unused-but-set-variable")
endif()
diff --git a/drivers/filesystems/ext2/CMakeLists.txt
b/drivers/filesystems/ext2/CMakeLists.txt
index 66278740f2..6d0bdb7d01 100644
--- a/drivers/filesystems/ext2/CMakeLists.txt
+++ b/drivers/filesystems/ext2/CMakeLists.txt
@@ -92,13 +92,20 @@ if(USE_CLANG_CL)
set_property(SOURCE src/create.c src/fileinfo.c src/memory.c src/read.c APPEND_STRING
PROPERTY COMPILE_FLAGS " /fallback")
endif()
-if(NOT MSVC)
- add_target_compile_flags(ext2fs "-Wno-pointer-sign -Wno-unused-function")
- add_target_compile_flags(ext2fs "-Wno-unused-but-set-variable
-Wno-unused-variable -Wno-missing-braces")
-else()
- #disable warnings: "unreferenced local variable", "initialized, but
not used variable", "benign include"
+if(MSVC AND (NOT USE_CLANG_CL))
+ # Disable warnings: "unreferenced local variable", "initialized, but
not used variable", "benign include"
replace_compile_flags("/we\"4189\"" " ")
add_target_compile_flags(ext2fs "/wd\"4189\" /wd\"4142\"
/wd\"4101\"")
+else()
+ add_target_compile_flags(ext2fs "-Wno-pointer-sign -Wno-unused-function")
+ add_target_compile_flags(ext2fs "-Wno-unused-variable
-Wno-missing-braces")
+ if(USE_CLANG_CL)
+ add_target_compile_flags(ext2fs "-Wno-unused-value
-Wno-parentheses-equality")
+ add_target_compile_flags(ext2fs
"-Wno-incompatible-pointer-types-discards-qualifiers")
+ add_target_compile_flags(ext2fs "-Wno-#pragma-messages
-Wno-cast-calling-convention")
+ else()
+ add_target_compile_flags(ext2fs "-Wno-unused-but-set-variable")
+ endif()
endif()
target_link_libraries(ext2fs memcmp ${PSEH_LIB})
diff --git a/drivers/filesystems/ffs/CMakeLists.txt
b/drivers/filesystems/ffs/CMakeLists.txt
index 1f353f078b..8138a15a5a 100644
--- a/drivers/filesystems/ffs/CMakeLists.txt
+++ b/drivers/filesystems/ffs/CMakeLists.txt
@@ -30,13 +30,14 @@ list(APPEND SOURCE
add_library(ffs SHARED ${SOURCE} src/ffsdrv.rc)
-if(NOT MSVC)
+if(USE_CLANG_CL OR (NOT MSVC))
add_target_compile_flags(ffs "-Wno-pointer-sign -Wno-unused-function")
- if(NOT CMAKE_C_COMPILER_ID STREQUAL "Clang")
- add_target_compile_flags(ffs "-Wno-unused-but-set-variable
-Wno-unused-variable -Wno-missing-braces")
+ add_target_compile_flags(ffs "-Wno-unused-variable -Wno-missing-braces")
+ if(USE_CLANG_CL)
+ add_target_compile_flags(ffs "-Wno-empty-body")
+ else()
+ add_target_compile_flags(ffs "-Wno-unused-but-set-variable")
endif()
-#else()
-# replace_compile_flags("/we\"4189\"" " ")
endif()
add_definitions(-D__KERNEL__)
diff --git a/drivers/filesystems/nfs/CMakeLists.txt
b/drivers/filesystems/nfs/CMakeLists.txt
index 6bf139f9f0..88f7fd7139 100644
--- a/drivers/filesystems/nfs/CMakeLists.txt
+++ b/drivers/filesystems/nfs/CMakeLists.txt
@@ -14,8 +14,11 @@ set_module_type(nfs41_driver kernelmodedriver)
target_link_libraries(nfs41_driver ntoskrnl_vista rdbsslib rxce copysup memcmp
${PSEH_LIB})
add_importlibs(nfs41_driver ntoskrnl hal)
-if((NOT MSVC) AND (NOT CMAKE_C_COMPILER_ID STREQUAL "Clang"))
+if(USE_CLANG_CL OR (NOT MSVC))
add_target_compile_flags(nfs41_driver "-Wno-switch")
+ if(USE_CLANG_CL)
+ add_target_compile_flags(nfs41_driver "-Wno-unused-value")
+ endif()
endif()
add_cd_file(TARGET nfs41_driver DESTINATION reactos/system32/drivers FOR all)
diff --git a/drivers/filesystems/reiserfs/CMakeLists.txt
b/drivers/filesystems/reiserfs/CMakeLists.txt
index 16dfc89e33..7990886489 100644
--- a/drivers/filesystems/reiserfs/CMakeLists.txt
+++ b/drivers/filesystems/reiserfs/CMakeLists.txt
@@ -78,10 +78,11 @@ list(APPEND SOURCE
add_library(reiserfs SHARED ${SOURCE} src/rfsd.rc)
-if(NOT MSVC)
- add_target_compile_flags(reiserfs "-Wno-pointer-sign
-Wno-unused-function")
- if(NOT CMAKE_C_COMPILER_ID STREQUAL "Clang")
- add_target_compile_flags(reiserfs "-Wno-unused-but-set-variable
-Wno-unused-variable -Wno-missing-braces -D__GCC__")
+if(USE_CLANG_CL OR (NOT MSVC))
+ add_target_compile_flags(reiserfs "-Wno-missing-braces -Wno-pointer-sign")
+ add_target_compile_flags(reiserfs "-Wno-unused-function
-Wno-unused-variable")
+ if(NOT USE_CLANG_CL)
+ add_target_compile_flags(reiserfs "-Wno-unused-but-set-variable
-D__GCC__")
endif()
else()
#disable warnings: "unreferenced local variable", "initialized, but
not used variable", "benign include"
diff --git a/drivers/filesystems/udfs/CMakeLists.txt
b/drivers/filesystems/udfs/CMakeLists.txt
index f91090b0e8..8b5df85fcf 100644
--- a/drivers/filesystems/udfs/CMakeLists.txt
+++ b/drivers/filesystems/udfs/CMakeLists.txt
@@ -42,12 +42,20 @@ list(APPEND SOURCE
udffs.h)
add_library(udfs SHARED ${SOURCE} udffs.rc)
+
if(MSVC)
# FIXME: Make sure we marked all what needs to be marked with stdcall before removing
this.
add_target_compile_flags(udfs "/Gz")
+ if(USE_CLANG_CL)
+ add_target_compile_flags(udfs "-Wno-extern-c-compat
-Wno-unused-value")
+ add_target_compile_flags(udfs
"-Wno-tautological-constant-out-of-range-compare")
+ add_target_compile_flags(udfs "-Wno-tautological-unsigned-zero-compare
-Wno-self-assign")
+ add_target_compile_flags(udfs "-Wno-sometimes-uninitialized
-Wno-parentheses-equality")
+ endif()
else()
add_target_compile_flags(udfs "-Wno-unused-but-set-variable")
endif()
+
set_module_type(udfs kernelmodedriver)
target_link_libraries(udfs ${PSEH_LIB})
add_importlibs(udfs ntoskrnl hal)
diff --git a/drivers/storage/class/cdrom_new/CMakeLists.txt
b/drivers/storage/class/cdrom_new/CMakeLists.txt
index d4d0853280..35c5b14ca5 100644
--- a/drivers/storage/class/cdrom_new/CMakeLists.txt
+++ b/drivers/storage/class/cdrom_new/CMakeLists.txt
@@ -12,10 +12,11 @@ list(APPEND SOURCE
add_library(cdrom_new SHARED ${SOURCE})
target_link_libraries(cdrom_new libcntpr wdmguid)
-if((ARCH STREQUAL "i386") AND (NOT MSVC))
- # FIXME:
http://www.cmake.org/Bug/view.php?id=12998
- #add_target_compile_flags(cdrom_new "-Wno-format -Wno-unused-variable
-Wno-pointer-sign")
- set_source_files_properties(${SOURCE} PROPERTIES COMPILE_FLAGS "-Wno-format
-Wno-unused-variable -Wno-pointer-sign")
+if(USE_CLANG_CL OR (NOT MSVC))
+ add_target_compile_flags(cdrom_new "-Wno-format -Wno-unused-variable
-Wno-pointer-sign")
+ if(USE_CLANG_CL)
+ add_target_compile_flags(cdrom_new "-Wno-enum-conversion
-Wno-tautological-constant-compare")
+ endif()
endif()
set_module_type(cdrom_new kernelmodedriver)
diff --git a/drivers/storage/class/disk_new/CMakeLists.txt
b/drivers/storage/class/disk_new/CMakeLists.txt
index d2065f07b3..df08fa8208 100644
--- a/drivers/storage/class/disk_new/CMakeLists.txt
+++ b/drivers/storage/class/disk_new/CMakeLists.txt
@@ -14,10 +14,8 @@ list(APPEND SOURCE
add_library(disk_new SHARED ${SOURCE} disk.rc)
target_link_libraries(disk_new libcntpr wdmguid)
-if((ARCH STREQUAL "i386") AND (NOT MSVC))
- # FIXME:
http://www.cmake.org/Bug/view.php?id=12998
- #add_target_compile_flags(disk_new "-Wno-format -Wno-pointer-sign")
- set_source_files_properties(${SOURCE} PROPERTIES COMPILE_FLAGS "-Wno-format
-Wno-pointer-sign")
+if(USE_CLANG_CL OR (NOT MSVC))
+ add_target_compile_flags(disk_new "-Wno-format -Wno-pointer-sign")
endif()
set_module_type(disk_new kernelmodedriver)
diff --git a/drivers/storage/ide/uniata/CMakeLists.txt
b/drivers/storage/ide/uniata/CMakeLists.txt
index a9e9b10d29..c7ffa34f43 100644
--- a/drivers/storage/ide/uniata/CMakeLists.txt
+++ b/drivers/storage/ide/uniata/CMakeLists.txt
@@ -22,9 +22,11 @@ list(APPEND SOURCE
add_library(uniata SHARED ${SOURCE} idedma.rc)
-if(NOT MSVC)
+if(USE_CLANG_CL OR (NOT MSVC))
add_target_compile_flags(uniata "-Wno-narrowing")
- if(NOT CMAKE_C_COMPILER_ID STREQUAL "Clang")
+ if(USE_CLANG_CL)
+ add_target_compile_flags(uniata "-Wno-unused-const-variable")
+ else()
add_target_compile_flags(uniata "-Wno-unused-but-set-variable")
endif()
endif()
diff --git a/drivers/wdm/audio/drivers/CMIDriver/CMakeLists.txt
b/drivers/wdm/audio/drivers/CMIDriver/CMakeLists.txt
index 0476aea4e7..6518ddb7ca 100644
--- a/drivers/wdm/audio/drivers/CMIDriver/CMakeLists.txt
+++ b/drivers/wdm/audio/drivers/CMIDriver/CMakeLists.txt
@@ -24,10 +24,8 @@ target_link_libraries(cmipci stdunk libcntpr uuid)
set_module_type(cmipci wdmdriver UNICODE)
add_importlibs(cmipci portcls hal ntoskrnl)
-if(NOT MSVC)
- # FIXME:
http://www.cmake.org/Bug/view.php?id=12998
- #add_target_compile_flags(cmipci "-Wno-write-strings -Wno-switch")
- set_source_files_properties(${SOURCE} PROPERTIES COMPILE_FLAGS
"-Wno-write-strings -Wno-switch")
+if(USE_CLANG_CL OR (NOT MSVC))
+ add_target_compile_flags(cmipci "-Wno-write-strings -Wno-switch")
endif()
add_pch(cmipci precomp.h SOURCE)
diff --git a/modules/rostests/winetests/advapi32/CMakeLists.txt
b/modules/rostests/winetests/advapi32/CMakeLists.txt
index 5005dd5adf..a148e08ddc 100644
--- a/modules/rostests/winetests/advapi32/CMakeLists.txt
+++ b/modules/rostests/winetests/advapi32/CMakeLists.txt
@@ -17,7 +17,7 @@ list(APPEND SOURCE
add_executable(advapi32_winetest ${SOURCE})
-if(NOT MSVC)
+if(USE_CLANG_CL OR (NOT MSVC))
add_target_compile_flags(advapi32_winetest "-Wno-format")
endif()
diff --git a/modules/rostests/winetests/comctl32/CMakeLists.txt
b/modules/rostests/winetests/comctl32/CMakeLists.txt
index 47d677d153..b1798c3018 100644
--- a/modules/rostests/winetests/comctl32/CMakeLists.txt
+++ b/modules/rostests/winetests/comctl32/CMakeLists.txt
@@ -33,12 +33,11 @@ list(APPEND SOURCE
testlist.c)
add_executable(comctl32_winetest ${SOURCE} rsrc.rc)
+
+if(USE_CLANG_CL OR (NOT MSVC))
+ add_target_compile_flags(comctl32_winetest "-Wno-format")
+endif()
+
set_module_type(comctl32_winetest win32cui)
add_importlibs(comctl32_winetest comctl32 ole32 user32 gdi32 advapi32 msvcrt kernel32)
add_rostests_file(TARGET comctl32_winetest)
-
-if(NOT MSVC)
- # FIXME:
http://www.cmake.org/Bug/view.php?id=12998
- #add_target_compile_flags(comctl32_winetest "-Wno-format")
- set_source_files_properties(${SOURCE} PROPERTIES COMPILE_FLAGS
"-Wno-format")
-endif()
diff --git a/modules/rostests/winetests/kernel32/CMakeLists.txt
b/modules/rostests/winetests/kernel32/CMakeLists.txt
index 90e4155ab9..af63b39d94 100644
--- a/modules/rostests/winetests/kernel32/CMakeLists.txt
+++ b/modules/rostests/winetests/kernel32/CMakeLists.txt
@@ -40,7 +40,7 @@ list(APPEND SOURCE
add_executable(kernel32_winetest ${SOURCE} resource.rc)
-if(NOT MSVC)
+if(USE_CLANG_CL OR (NOT MSVC))
add_target_compile_flags(kernel32_winetest "-Wno-format")
endif()
diff --git a/modules/rostests/winetests/msvcrt/CMakeLists.txt
b/modules/rostests/winetests/msvcrt/CMakeLists.txt
index ecd725d42f..5aba4c2f7f 100644
--- a/modules/rostests/winetests/msvcrt/CMakeLists.txt
+++ b/modules/rostests/winetests/msvcrt/CMakeLists.txt
@@ -22,14 +22,17 @@ list(APPEND SOURCE
time.c)
add_executable(msvcrt_winetest ${SOURCE})
+
+if(USE_CLANG_CL OR (NOT MSVC))
+ add_target_compile_flags(msvcrt_winetest "-Wno-format")
+endif()
+
set_module_type(msvcrt_winetest win32cui)
add_importlibs(msvcrt_winetest msvcrt kernel32)
if(MSVC)
target_link_libraries(msvcrt_winetest oldnames)
add_importlibs(msvcrt_winetest ntdll)
-else()
- add_target_compile_flags(msvcrt_winetest "-Wno-format")
endif()
add_rostests_file(TARGET msvcrt_winetest)
diff --git a/modules/rostests/winetests/ntdll/CMakeLists.txt
b/modules/rostests/winetests/ntdll/CMakeLists.txt
index f1055f85db..0bbc8d33a1 100644
--- a/modules/rostests/winetests/ntdll/CMakeLists.txt
+++ b/modules/rostests/winetests/ntdll/CMakeLists.txt
@@ -33,10 +33,11 @@ if(ARCH STREQUAL "i386")
endif()
add_executable(ntdll_winetest ${SOURCE})
-set_module_type(ntdll_winetest win32cui)
-add_importlibs(ntdll_winetest user32 ole32 advapi32 msvcrt kernel32 ntdll)
-add_rostests_file(TARGET ntdll_winetest)
-if(NOT MSVC)
+if(USE_CLANG_CL OR (NOT MSVC))
add_target_compile_flags(ntdll_winetest "-Wno-format")
endif()
+
+set_module_type(ntdll_winetest win32cui)
+add_importlibs(ntdll_winetest user32 ole32 advapi32 msvcrt kernel32 ntdll)
+add_rostests_file(TARGET ntdll_winetest)
diff --git a/modules/rostests/winetests/rpcrt4/CMakeLists.txt
b/modules/rostests/winetests/rpcrt4/CMakeLists.txt
index eac31545f4..ea8c329a3d 100644
--- a/modules/rostests/winetests/rpcrt4/CMakeLists.txt
+++ b/modules/rostests/winetests/rpcrt4/CMakeLists.txt
@@ -28,11 +28,15 @@ if(MSVC)
endif()
add_executable(rpcrt4_winetest ${SOURCE})
+
+if(USE_CLANG_CL OR (NOT MSVC))
+ add_target_compile_flags(rpcrt4_winetest "-Wno-format")
+ if(USE_CLANG_CL)
+ add_target_compile_flags(rpcrt4_winetest
"-Wno-cast-calling-convention")
+ endif()
+endif()
+
target_link_libraries(rpcrt4_winetest uuid wine ${PSEH_LIB})
set_module_type(rpcrt4_winetest win32cui)
add_importlibs(rpcrt4_winetest oleaut32 ole32 rpcrt4 secur32 advapi32 msvcrt kernel32
ntdll)
add_rostests_file(TARGET rpcrt4_winetest)
-
-if(NOT MSVC)
- add_target_compile_flags(rpcrt4_winetest "-Wno-format")
-endif()
diff --git a/modules/rostests/winetests/winmm/CMakeLists.txt
b/modules/rostests/winetests/winmm/CMakeLists.txt
index 21656afc6d..6412b65df1 100644
--- a/modules/rostests/winetests/winmm/CMakeLists.txt
+++ b/modules/rostests/winetests/winmm/CMakeLists.txt
@@ -12,14 +12,12 @@ list(APPEND SOURCE
wave.c)
add_executable(winmm_winetest ${SOURCE})
+
+if(USE_CLANG_CL OR (NOT MSVC))
+ add_target_compile_flags(winmm_winetest "-Wno-format")
+endif()
+
target_link_libraries(winmm_winetest dxguid)
set_module_type(winmm_winetest win32cui)
add_importlibs(winmm_winetest winmm user32 advapi32 ole32 msvcrt kernel32)
add_rostests_file(TARGET winmm_winetest)
-
-if(NOT MSVC)
- add_target_compile_flags(winmm_winetest "-Wno-format")
- if(NOT CMAKE_C_COMPILER_ID STREQUAL "Clang")
- add_target_compile_flags(winmm_winetest
"-Wno-unused-but-set-variable")
- endif()
-endif()
diff --git a/modules/rostests/winetests/ws2_32/CMakeLists.txt
b/modules/rostests/winetests/ws2_32/CMakeLists.txt
index 2428444907..8e0946d609 100644
--- a/modules/rostests/winetests/ws2_32/CMakeLists.txt
+++ b/modules/rostests/winetests/ws2_32/CMakeLists.txt
@@ -2,10 +2,11 @@
include_directories(BEFORE ${REACTOS_SOURCE_DIR}/sdk/include/reactos/wine)
add_executable(ws2_32_winetest protocol.c sock.c testlist.c)
-set_module_type(ws2_32_winetest win32cui)
-add_importlibs(ws2_32_winetest ws2_32 user32 msvcrt kernel32)
-add_rostests_file(TARGET ws2_32_winetest)
-if(NOT MSVC)
+if(USE_CLANG_CL OR (NOT MSVC))
add_target_compile_flags(ws2_32_winetest "-Wno-format")
endif()
+
+set_module_type(ws2_32_winetest win32cui)
+add_importlibs(ws2_32_winetest ws2_32 user32 msvcrt kernel32)
+add_rostests_file(TARGET ws2_32_winetest)
diff --git a/sdk/lib/3rdparty/adns/CMakeLists.txt b/sdk/lib/3rdparty/adns/CMakeLists.txt
index b8187d8fd1..058cf73f62 100644
--- a/sdk/lib/3rdparty/adns/CMakeLists.txt
+++ b/sdk/lib/3rdparty/adns/CMakeLists.txt
@@ -22,9 +22,10 @@ list(APPEND SOURCE
src/internal.h)
add_library(adns ${SOURCE})
-add_dependencies(adns psdk)
-add_pch(adns src/internal.h SOURCE)
-if((NOT MSVC) AND (NOT CMAKE_C_COMPILER_ID STREQUAL "Clang"))
+if(NOT MSVC)
add_target_compile_flags(adns "-Wno-unused-but-set-variable")
endif()
+
+add_dependencies(adns psdk)
+add_pch(adns src/internal.h SOURCE)
diff --git a/sdk/lib/3rdparty/cardlib/CMakeLists.txt
b/sdk/lib/3rdparty/cardlib/CMakeLists.txt
index d624197436..224d8d396c 100644
--- a/sdk/lib/3rdparty/cardlib/CMakeLists.txt
+++ b/sdk/lib/3rdparty/cardlib/CMakeLists.txt
@@ -16,9 +16,10 @@ list(APPEND SOURCE
cardlib.h)
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)
add_target_compile_flags(cardlib "-Wno-unused-but-set-variable")
endif()
+
+add_dependencies(cardlib psdk)
+add_pch(cardlib cardlib.h SOURCE)
diff --git a/sdk/lib/3rdparty/libxml2/CMakeLists.txt
b/sdk/lib/3rdparty/libxml2/CMakeLists.txt
index 5eb0dc7da7..033afe6d1a 100644
--- a/sdk/lib/3rdparty/libxml2/CMakeLists.txt
+++ b/sdk/lib/3rdparty/libxml2/CMakeLists.txt
@@ -63,11 +63,8 @@ list(APPEND SOURCE
libxml.h)
add_library(libxml2 ${SOURCE})
-target_link_libraries(libxml2 oldnames)
-add_pch(libxml2 libxml.h SOURCE)
-add_dependencies(libxml2 psdk)
-if(MSVC)
+if(MSVC AND (NOT USE_CLANG_CL))
# Formal parameter different from declaration
add_target_compile_flags(libxml2 "/wd4101")
# Local variable initialized but not referenced
@@ -75,3 +72,7 @@ if(MSVC)
else()
add_target_compile_flags(libxml2 "-w")
endif()
+
+target_link_libraries(libxml2 oldnames)
+add_pch(libxml2 libxml.h SOURCE)
+add_dependencies(libxml2 psdk)