mirror of
https://github.com/reactos/reactos.git
synced 2025-07-31 10:01:43 +00:00
[CMAKE/CLANG-CL] Silence some clang-cl warnings in consistency with our gcc build.
This commit is contained in:
parent
6fe9441d32
commit
00124d1b1a
29 changed files with 113 additions and 82 deletions
|
@ -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()
|
||||
|
||||
|
|
|
@ -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})
|
||||
|
|
|
@ -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__)
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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()
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue