mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 01:55:19 +00:00
[CMAKE] Clang*: Add '-Werror=unknown-warning-option' for C/CXX (#6383)
* [UDFS] Clang: Fix a #pragma 'warning: unknown warning group '-Wstringop-overflow', ignored [-Wunknown-warning-option]' Follow-up to612b1f2e6
(0.4.15-dev-1129). * [CREATESPEC] Clang: Fix a target_compile_options() 'warning: unknown warning option '-Wno-stringop-overflow'; did you mean '-Wno-shift-overflow'? [-Wunknown-warning-option]' Addendum to00ed72d7e
(0.4.15-dev-1169). * [MSVCRT_WINETEST] Clang*: Fix a target_compile_options() 'warning: unknown warning option '-Wno-stringop-truncation'; did you mean '-Wno-string-concatenation'? [-Wunknown-warning-option]' Addendum to commits00ed72d7e
(0.4.15-dev-1169) thenf155b9377
(0.4.15-dev-4612). * [TELNET] Clang*: Fix a target_compile_options() 'warning: unknown warning option '-Wno-restrict' [-Wunknown-warning-option]' Addendum to447ef2aa4
(0.4.15-dev-4613).
This commit is contained in:
parent
b50ab0dc68
commit
3cc4361cca
6 changed files with 18 additions and 8 deletions
|
@ -36,7 +36,10 @@ if (NOT MSVC)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(CMAKE_C_COMPILER_ID STREQUAL "GNU" OR CMAKE_C_COMPILER_ID STREQUAL "Clang")
|
if(CMAKE_C_COMPILER_ID STREQUAL "GNU" OR CMAKE_C_COMPILER_ID STREQUAL "Clang")
|
||||||
target_compile_options(telnet PRIVATE -Wno-restrict $<$<COMPILE_LANGUAGE:CXX>:-Wno-narrowing>)
|
target_compile_options(telnet PRIVATE $<$<COMPILE_LANGUAGE:CXX>:-Wno-narrowing>)
|
||||||
|
if(CMAKE_C_COMPILER_ID STREQUAL "GNU")
|
||||||
|
target_compile_options(telnet PRIVATE $<$<COMPILE_LANGUAGE:CXX>:-Wno-restrict>)
|
||||||
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
set_module_type(telnet win32cui)
|
set_module_type(telnet win32cui)
|
||||||
|
|
|
@ -222,7 +222,7 @@ VOID inline MyFreePool__(PVOID addr) {
|
||||||
#endif //MY_MEM_BOUNDS_CHECK
|
#endif //MY_MEM_BOUNDS_CHECK
|
||||||
|
|
||||||
/* This function just scares the hell out of GCC */
|
/* This function just scares the hell out of GCC */
|
||||||
#ifdef __GNUC__
|
#if defined(__GNUC__) && !defined(__clang__)
|
||||||
#pragma GCC diagnostic push
|
#pragma GCC diagnostic push
|
||||||
#pragma GCC diagnostic ignored "-Wstringop-overflow"
|
#pragma GCC diagnostic ignored "-Wstringop-overflow"
|
||||||
#endif
|
#endif
|
||||||
|
@ -298,7 +298,7 @@ ULONG inline MyReallocPool__(PCHAR addr, ULONG len, PCHAR *pnewaddr, ULONG newle
|
||||||
*/
|
*/
|
||||||
return newlen;
|
return newlen;
|
||||||
}
|
}
|
||||||
#ifdef __GNUC__
|
#if defined(__GNUC__) && !defined(__clang__)
|
||||||
#pragma GCC diagnostic pop
|
#pragma GCC diagnostic pop
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -2,8 +2,8 @@
|
||||||
add_executable(createspec createspec.c)
|
add_executable(createspec createspec.c)
|
||||||
set_module_type(createspec win32cui)
|
set_module_type(createspec win32cui)
|
||||||
target_link_libraries(createspec wine)
|
target_link_libraries(createspec wine)
|
||||||
if(NOT MSVC)
|
if(CMAKE_C_COMPILER_ID STREQUAL "GNU")
|
||||||
target_compile_options(createspec PRIVATE -Wno-stringop-overflow)
|
target_compile_options(createspec PRIVATE $<$<COMPILE_LANGUAGE:C>:-Wno-stringop-overflow>)
|
||||||
endif()
|
endif()
|
||||||
add_importlibs(createspec dbghelp msvcrt kernel32)
|
add_importlibs(createspec dbghelp msvcrt kernel32)
|
||||||
add_cd_file(TARGET createspec DESTINATION reactos/system32 FOR all)
|
add_cd_file(TARGET createspec DESTINATION reactos/system32 FOR all)
|
||||||
|
|
|
@ -28,7 +28,10 @@ target_compile_definitions(msvcrt_winetest PRIVATE
|
||||||
__msvcrt_ulong=ULONG)
|
__msvcrt_ulong=ULONG)
|
||||||
|
|
||||||
if(CMAKE_C_COMPILER_ID STREQUAL "GNU" OR CMAKE_C_COMPILER_ID STREQUAL "Clang")
|
if(CMAKE_C_COMPILER_ID STREQUAL "GNU" OR CMAKE_C_COMPILER_ID STREQUAL "Clang")
|
||||||
target_compile_options(msvcrt_winetest PRIVATE -Wno-format -Wno-stringop-truncation -Wno-overflow)
|
target_compile_options(msvcrt_winetest PRIVATE $<$<COMPILE_LANGUAGE:C>:-Wno-format -Wno-overflow>)
|
||||||
|
if(CMAKE_C_COMPILER_ID STREQUAL "GNU")
|
||||||
|
target_compile_options(msvcrt_winetest PRIVATE $<$<COMPILE_LANGUAGE:C>:-Wno-stringop-truncation>)
|
||||||
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
set_module_type(msvcrt_winetest win32cui)
|
set_module_type(msvcrt_winetest win32cui)
|
||||||
|
|
|
@ -96,6 +96,10 @@ add_compile_options(-march=${OARCH} -mtune=${TUNE})
|
||||||
# Warnings, errors
|
# Warnings, errors
|
||||||
if((NOT CMAKE_BUILD_TYPE STREQUAL "Release") AND (NOT CMAKE_C_COMPILER_ID STREQUAL Clang))
|
if((NOT CMAKE_BUILD_TYPE STREQUAL "Release") AND (NOT CMAKE_C_COMPILER_ID STREQUAL Clang))
|
||||||
add_compile_options(-Werror)
|
add_compile_options(-Werror)
|
||||||
|
else()
|
||||||
|
if(CMAKE_C_COMPILER_ID STREQUAL "Clang")
|
||||||
|
add_compile_options($<$<COMPILE_LANGUAGE:C,CXX>:-Werror=unknown-warning-option>)
|
||||||
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
add_compile_options(-Wall -Wpointer-arith)
|
add_compile_options(-Wall -Wpointer-arith)
|
||||||
|
|
|
@ -23,8 +23,7 @@ endif()
|
||||||
add_compile_options(/GF)
|
add_compile_options(/GF)
|
||||||
|
|
||||||
# Enable function level linking and comdat folding (only C/C++, not ASM!)
|
# Enable function level linking and comdat folding (only C/C++, not ASM!)
|
||||||
add_compile_options($<$<COMPILE_LANGUAGE:CXX>:/Gy>)
|
add_compile_options($<$<COMPILE_LANGUAGE:C,CXX>:/Gy>)
|
||||||
add_compile_options($<$<COMPILE_LANGUAGE:C>:/Gy>)
|
|
||||||
add_link_options(/OPT:REF /OPT:ICF)
|
add_link_options(/OPT:REF /OPT:ICF)
|
||||||
|
|
||||||
if(ARCH STREQUAL "i386")
|
if(ARCH STREQUAL "i386")
|
||||||
|
@ -145,6 +144,7 @@ endif()
|
||||||
add_compile_options(/w14115)
|
add_compile_options(/w14115)
|
||||||
|
|
||||||
if(CMAKE_C_COMPILER_ID STREQUAL "Clang")
|
if(CMAKE_C_COMPILER_ID STREQUAL "Clang")
|
||||||
|
add_compile_options($<$<COMPILE_LANGUAGE:C,CXX>:-Werror=unknown-warning-option>)
|
||||||
add_compile_options("$<$<COMPILE_LANGUAGE:C,CXX>:-nostdinc;-Wno-multichar;-Wno-char-subscripts;-Wno-microsoft-enum-forward-reference;-Wno-pragma-pack;-Wno-microsoft-anon-tag;-Wno-parentheses-equality;-Wno-unknown-pragmas>")
|
add_compile_options("$<$<COMPILE_LANGUAGE:C,CXX>:-nostdinc;-Wno-multichar;-Wno-char-subscripts;-Wno-microsoft-enum-forward-reference;-Wno-pragma-pack;-Wno-microsoft-anon-tag;-Wno-parentheses-equality;-Wno-unknown-pragmas>")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue