mirror of
https://github.com/reactos/reactos.git
synced 2025-05-31 23:18:39 +00:00
[CMAKE] Use remove_target_compile_option when disabling manually enabled warnings
This commit is contained in:
parent
b410220f39
commit
fc2b105e5d
9 changed files with 24 additions and 21 deletions
|
@ -20,5 +20,5 @@ add_cd_file(TARGET wordpad DESTINATION reactos/system32 FOR all)
|
|||
|
||||
if(MSVC)
|
||||
# Disable warning C4477 (printf format warnings)
|
||||
target_compile_options(wordpad PRIVATE /wd4477)
|
||||
remove_target_compile_option(wordpad "/we4477")
|
||||
endif()
|
||||
|
|
|
@ -50,7 +50,7 @@ add_executable(nfsd ${SOURCE} nfsd.rc)
|
|||
|
||||
if(MSVC AND (NOT USE_CLANG_CL))
|
||||
# Disable warning C4477 (printf format warnings)
|
||||
target_compile_options(nfsd PRIVATE "/wd4477")
|
||||
remove_target_compile_option(nfsd "/we4477")
|
||||
else()
|
||||
# FIXME: Tons of warnings.
|
||||
target_compile_options(nfsd PRIVATE "-w")
|
||||
|
|
4
dll/3rdparty/libtirpc/CMakeLists.txt
vendored
4
dll/3rdparty/libtirpc/CMakeLists.txt
vendored
|
@ -96,8 +96,10 @@ add_library(libtirpc MODULE
|
|||
if(MSVC)
|
||||
# error C4133: '=': incompatible types - from 'char *' to 'int32_t *'
|
||||
remove_target_compile_option(libtirpc "/we4133")
|
||||
# Disable warning C4313 (format string conflicts)
|
||||
remove_target_compile_option(libtirpc "/we4313")
|
||||
# Disable warning C4477 (printf format warnings)
|
||||
target_compile_options(libtirpc PRIVATE /wd4313)
|
||||
remove_target_compile_option(libtirpc "/we4477")
|
||||
if (NOT USE_CLANG_CL)
|
||||
remove_target_compile_option(libtirpc "/we4101")
|
||||
target_compile_options(libtirpc PRIVATE /wd4101 /wd4133 /wd4473 /wd4477)
|
||||
|
|
|
@ -64,9 +64,9 @@ add_library(comctl32 MODULE
|
|||
rsrc.rc
|
||||
${CMAKE_CURRENT_BINARY_DIR}/comctl32.def)
|
||||
|
||||
if (MSVC)
|
||||
if(MSVC)
|
||||
# Disable warning C4477 (printf format warnings)
|
||||
target_compile_options(comctl32 PRIVATE /wd4477)
|
||||
remove_target_compile_option(comctl32 "/we4477")
|
||||
endif()
|
||||
|
||||
set_module_type(comctl32 win32dll UNICODE)
|
||||
|
|
|
@ -80,7 +80,8 @@ else()
|
|||
add_pch(dbghelp precomp.h SOURCE)
|
||||
add_cd_file(TARGET dbghelp DESTINATION reactos/system32 FOR all)
|
||||
|
||||
if (MSVC)
|
||||
target_compile_options(dbghelp PRIVATE /wd4477)
|
||||
if(MSVC)
|
||||
# Disable warning C4477 (printf format warnings)
|
||||
remove_target_compile_option(dbghelp "/we4477")
|
||||
endif()
|
||||
endif()
|
||||
|
|
|
@ -1,15 +1,4 @@
|
|||
|
||||
if(MSVC)
|
||||
add_compile_options("/wd4189") # error C4189: 'Index2': local variable is initialized but not referenced
|
||||
add_compile_options("/wd4197") # warning C4197: 'volatile LONG': top-level volatile in cast is ignored
|
||||
add_compile_options("/wd4532") # warning C4532: 'break': jump out of __finally block has undefined behavior during termination handling
|
||||
else()
|
||||
add_compile_options("-Wno-format")
|
||||
add_compile_options("-Wno-implicit-function-declaration")
|
||||
add_compile_options("-Wno-unused-label")
|
||||
add_compile_options("-Wno-unused-variable")
|
||||
endif()
|
||||
|
||||
foreach(num RANGE 1 9)
|
||||
list(APPEND SOURCE seh000${num}.c)
|
||||
set_source_files_properties(seh000${num}.c PROPERTIES COMPILE_DEFINITIONS
|
||||
|
@ -24,3 +13,14 @@ endforeach()
|
|||
|
||||
add_library(ms_seh_test ${SOURCE})
|
||||
add_dependencies(ms_seh_test psdk)
|
||||
|
||||
if(MSVC)
|
||||
# error C4189: 'Index2': local variable is initialized but not referenced
|
||||
# warning C4197: 'volatile LONG': top-level volatile in cast is ignored
|
||||
# warning C4532: 'break': jump out of __finally block has undefined behavior during termination handling
|
||||
remove_target_compile_option(ms_seh_test "/we4189")
|
||||
target_compile_options(ms_seh_test PRIVATE /wd4189 /wd4197 /wd4532)
|
||||
else()
|
||||
target_compile_options(ms_seh_test
|
||||
PRIVATE -Wno-format -Wno-implicit-function-declaration -Wno-unused-label -Wno-unused-variable)
|
||||
endif()
|
||||
|
|
|
@ -16,7 +16,7 @@ add_executable(d3dx9_36_winetest
|
|||
target_compile_definitions(d3dx9_36_winetest PRIVATE -DUSE_WINE_TODOS -D__WINESRC__ -Disnan=_isnan)
|
||||
if(MSVC)
|
||||
# Disable warning C4477 (printf format warnings)
|
||||
target_compile_options(d3dx9_36_winetest PRIVATE "/wd4477")
|
||||
remove_target_compile_option(d3dx9_36_winetest "/we4477")
|
||||
endif()
|
||||
|
||||
target_link_libraries(d3dx9_36_winetest uuid dxguid)
|
||||
|
|
|
@ -47,7 +47,7 @@ add_executable(kernel32_winetest
|
|||
|
||||
if(MSVC)
|
||||
# Disable warning C4477 (printf format warnings)
|
||||
target_compile_options(kernel32_winetest PRIVATE /wd4477)
|
||||
remove_target_compile_option(kernel32_winetest "/we4477")
|
||||
endif()
|
||||
|
||||
if(USE_CLANG_CL OR (NOT MSVC))
|
||||
|
|
|
@ -39,7 +39,7 @@ add_executable(user32_winetest
|
|||
|
||||
if(MSVC)
|
||||
# Disable warning C4477 (printf format warnings)
|
||||
target_compile_options(user32_winetest PRIVATE /wd4477)
|
||||
remove_target_compile_option(user32_winetest "/we4477")
|
||||
elseif(GCC)
|
||||
target_compile_options(user32_winetest PRIVATE -Wno-format-overflow)
|
||||
endif()
|
||||
|
|
Loading…
Reference in a new issue