[CMAKE] Some options are only supported by GCC, don't use them for clang

These are (so far):
-Wno-format-overflow
-Wno-nonnull-compare
-Wno-old-style-declaration
-Wno-unused-but-set-variable
This commit is contained in:
Victor Perevertkin 2021-04-09 03:58:19 +03:00
parent 959729f6ee
commit 74ec94e12c
35 changed files with 99 additions and 57 deletions

View file

@ -103,9 +103,10 @@ else()
target_compile_options(ext2fs PRIVATE
-Wno-pointer-sign -Wno-unused-function
-Wno-unused-variable -Wno-missing-braces)
if (NOT CLANG)
target_compile_options(ext2fs PRIVATE -Wno-unused-but-set-variable)
endif()
endif()
if(CMAKE_C_COMPILER_ID STREQUAL "GNU")
target_compile_options(ext2fs PRIVATE -Wno-unused-but-set-variable)
endif()
if(CLANG)

View file

@ -35,11 +35,13 @@ if(USE_CLANG_CL OR (NOT MSVC))
target_compile_options(ffs PRIVATE -Wno-unused-variable -Wno-missing-braces)
if(USE_CLANG_CL)
target_compile_options(ffs PRIVATE -Wno-empty-body)
else()
target_compile_options(ffs PRIVATE -Wno-unused-but-set-variable)
endif()
endif()
if(CMAKE_C_COMPILER_ID STREQUAL "GNU")
target_compile_options(ffs PRIVATE -Wno-unused-but-set-variable)
endif()
add_definitions(-D__KERNEL__)
set_module_type(ffs kernelmodedriver)
target_link_libraries(ffs memcmp ${PSEH_LIB})

View file

@ -82,7 +82,6 @@ if(USE_CLANG_CL OR (NOT MSVC))
target_compile_options(reiserfs PRIVATE -Wno-missing-braces -Wno-pointer-sign)
target_compile_options(reiserfs PRIVATE -Wno-unused-function -Wno-unused-variable)
if(NOT USE_CLANG_CL)
target_compile_options(reiserfs PRIVATE -Wno-unused-but-set-variable)
target_compile_definitions(reiserfs PRIVATE __GCC__)
endif()
else()
@ -92,6 +91,10 @@ else()
target_compile_options(reiserfs PRIVATE /wd4189 /wd4142 /wd4101)
endif()
if(CMAKE_C_COMPILER_ID STREQUAL "GNU")
target_compile_options(reiserfs PRIVATE -Wno-unused-but-set-variable)
endif()
target_link_libraries(reiserfs memcmp ${PSEH_LIB})
add_definitions(-D__KERNEL__ -D_CRT_NO_POSIX_ERROR_CODES)
set_module_type(reiserfs kernelmodedriver)

View file

@ -50,8 +50,10 @@ if(MSVC)
target_compile_options(udfs PRIVATE -Wno-tautological-unsigned-zero-compare -Wno-self-assign)
target_compile_options(udfs PRIVATE -Wno-sometimes-uninitialized -Wno-parentheses-equality)
endif()
else()
target_compile_options(udfs PRIVATE "-Wno-unused-but-set-variable")
endif()
if(CMAKE_C_COMPILER_ID STREQUAL "GNU")
target_compile_options(udfs PRIVATE -Wno-unused-but-set-variable)
endif()
set_module_type(udfs kernelmodedriver)