mirror of
https://github.com/reactos/reactos.git
synced 2025-08-02 00:03:22 +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
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue