mirror of
https://github.com/reactos/reactos.git
synced 2025-08-07 05:52:57 +00:00
[CMAKE] Elimitate the use of GCC and CLANG variables
This commit is contained in:
parent
6f4be52a1c
commit
f155b9377f
32 changed files with 78 additions and 116 deletions
|
@ -88,26 +88,21 @@ list(APPEND SOURCE
|
|||
|
||||
add_library(ext2fs MODULE ${SOURCE} ext2fs.rc)
|
||||
|
||||
if(MSVC)
|
||||
if (NOT CLANG)
|
||||
# Disable warning C4101: 'i': unreferenced local variable
|
||||
# Disable warning C4189: 'sbi': local variable is initialized but not referenced
|
||||
# Disable warning C4267: '=': conversion from 'size_t' to 'USHORT', possible loss of data
|
||||
target_compile_options(ext2fs PRIVATE /wd4101 /wd4189 /wd4267)
|
||||
endif()
|
||||
else()
|
||||
target_compile_options(ext2fs PRIVATE
|
||||
-Wno-pointer-sign -Wno-unused-function
|
||||
-Wno-unused-variable -Wno-missing-braces)
|
||||
if(CMAKE_C_COMPILER_ID STREQUAL "MSVC")
|
||||
# Disable warning C4101: 'i': unreferenced local variable
|
||||
# Disable warning C4189: 'sbi': local variable is initialized but not referenced
|
||||
# Disable warning C4267: '=': conversion from 'size_t' to 'USHORT', possible loss of data
|
||||
target_compile_options(ext2fs PRIVATE /wd4101 /wd4189 /wd4267)
|
||||
endif()
|
||||
|
||||
if(CMAKE_C_COMPILER_ID STREQUAL "GNU")
|
||||
target_compile_options(ext2fs PRIVATE -Wno-unused-but-set-variable)
|
||||
if(CMAKE_C_COMPILER_ID STREQUAL "GNU" OR CMAKE_C_COMPILER_ID STREQUAL "Clang")
|
||||
target_compile_options(ext2fs PRIVATE
|
||||
-Wno-pointer-sign -Wno-unused-function -Wno-unused-variable -Wno-missing-braces -Wno-unused-but-set-variable)
|
||||
endif()
|
||||
|
||||
if(CLANG)
|
||||
if(CMAKE_C_COMPILER_ID STREQUAL "Clang")
|
||||
target_compile_options(ext2fs PRIVATE
|
||||
-Wno-unused-value -Wno-parentheses-equality
|
||||
-Wno-parentheses-equality
|
||||
-Wno-incompatible-pointer-types-discards-qualifiers
|
||||
"-Wno-#pragma-messages;-Wno-cast-calling-convention")
|
||||
endif()
|
||||
|
|
|
@ -38,7 +38,7 @@ list(APPEND SOURCE
|
|||
add_library(fastfat MODULE ${SOURCE} fastfat.rc)
|
||||
set_module_type(fastfat kernelmodedriver)
|
||||
target_link_libraries(fastfat ${PSEH_LIB} memcmp)
|
||||
if(GDB AND NOT CLANG)
|
||||
if(GDB AND NOT CMAKE_C_COMPILER_ID STREQUAL "Clang")
|
||||
target_compile_options(fastfat PRIVATE -O0)
|
||||
endif()
|
||||
add_importlibs(fastfat ntoskrnl hal)
|
||||
|
|
|
@ -14,12 +14,14 @@ 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(GCC OR CLANG)
|
||||
if(CMAKE_C_COMPILER_ID STREQUAL "GNU" OR CMAKE_C_COMPILER_ID STREQUAL "Clang")
|
||||
target_compile_options(nfs41_driver PRIVATE "-Wno-switch")
|
||||
if(CLANG)
|
||||
target_compile_options(nfs41_driver PRIVATE "-Wno-unused-value")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(CMAKE_C_COMPILER_ID STREQUAL "Clang")
|
||||
target_compile_options(nfs41_driver PRIVATE "-Wno-unused-value")
|
||||
endif()
|
||||
|
||||
set_property(TARGET nfs41_driver PROPERTY C_STANDARD 90)
|
||||
|
||||
add_cd_file(TARGET nfs41_driver DESTINATION reactos/system32/drivers FOR all)
|
||||
|
|
|
@ -41,19 +41,17 @@ list(APPEND SOURCE
|
|||
|
||||
add_library(udfs MODULE ${SOURCE} udffs.rc)
|
||||
|
||||
if(MSVC)
|
||||
if(USE_CLANG_CL)
|
||||
target_compile_options(udfs PRIVATE -Wno-extern-c-compat -Wno-unused-value)
|
||||
target_compile_options(udfs PRIVATE -Wno-tautological-constant-out-of-range-compare)
|
||||
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()
|
||||
endif()
|
||||
|
||||
if(CMAKE_C_COMPILER_ID STREQUAL "GNU")
|
||||
target_compile_options(udfs PRIVATE -Wno-unused-but-set-variable)
|
||||
endif()
|
||||
|
||||
if(CMAKE_C_COMPILER_ID STREQUAL "Clang")
|
||||
target_compile_options(udfs PRIVATE -Wno-extern-c-compat -Wno-unused-value)
|
||||
target_compile_options(udfs PRIVATE -Wno-tautological-constant-out-of-range-compare)
|
||||
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()
|
||||
|
||||
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