From e59cf523ac97a09a0b6a7aa573e1a2902dfe6f9e Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Gardou?= Date: Sun, 4 Sep 2011 17:32:30 +0000 Subject: [PATCH] [CMAKE] - enable -Werror by default on gcc build svn path=/trunk/; revision=53585 --- reactos/base/applications/winhlp32/CMakeLists.txt | 4 ++++ reactos/base/applications/wordpad/CMakeLists.txt | 4 ++++ reactos/base/applications/write/CMakeLists.txt | 4 ++++ reactos/cmake/gcc.cmake | 7 +++++++ reactos/dll/3rdparty/libtiff/CMakeLists.txt | 6 +++++- reactos/dll/3rdparty/libxslt/CMakeLists.txt | 4 ++++ reactos/dll/3rdparty/mesa32/CMakeLists.txt | 6 +++++- reactos/dll/directx/quartz/CMakeLists.txt | 4 ++++ reactos/dll/directx/wine/wined3d/CMakeLists.txt | 4 ++++ reactos/dll/win32/cabinet/CMakeLists.txt | 2 +- reactos/dll/win32/itss/CMakeLists.txt | 2 ++ reactos/dll/win32/jscript/CMakeLists.txt | 4 ++++ reactos/dll/win32/localspl/CMakeLists.txt | 4 ++++ reactos/dll/win32/mciseq/CMakeLists.txt | 7 ++++++- reactos/dll/win32/mciwave/CMakeLists.txt | 7 ++++++- reactos/dll/win32/rpcrt4/CMakeLists.txt | 4 ++++ reactos/dll/win32/shdocvw/CMakeLists.txt | 4 ++++ reactos/dll/win32/winhttp/CMakeLists.txt | 4 ++++ reactos/dll/win32/wininet/CMakeLists.txt | 4 ++++ reactos/lib/3rdparty/libxml2/CMakeLists.txt | 4 ++++ reactos/lib/drivers/lwip/CMakeLists.txt | 3 +++ reactos/lib/rossym_new/CMakeLists.txt | 1 + reactos/lib/sdk/crt/msvcrtex.cmake | 1 + 23 files changed, 89 insertions(+), 5 deletions(-) diff --git a/reactos/base/applications/winhlp32/CMakeLists.txt b/reactos/base/applications/winhlp32/CMakeLists.txt index 6f3b9e1b7d4..1391b0c993f 100644 --- a/reactos/base/applications/winhlp32/CMakeLists.txt +++ b/reactos/base/applications/winhlp32/CMakeLists.txt @@ -22,3 +22,7 @@ set_module_type(winhlp32 win32gui) target_link_libraries(winhlp32 wine) add_importlibs(winhlp32 user32 gdi32 shell32 comctl32 comdlg32 msvcrt kernel32 ntdll) add_cd_file(TARGET winhlp32 DESTINATION reactos FOR all) + +if(NOT MSVC) + allow_warnings(winhlp32) +endif() diff --git a/reactos/base/applications/wordpad/CMakeLists.txt b/reactos/base/applications/wordpad/CMakeLists.txt index d04e11ccbe5..62915f6dbcd 100644 --- a/reactos/base/applications/wordpad/CMakeLists.txt +++ b/reactos/base/applications/wordpad/CMakeLists.txt @@ -18,3 +18,7 @@ set_module_type(wordpad win32gui) target_link_libraries(wordpad wine uuid) add_importlibs(wordpad comdlg32 ole32 shell32 user32 gdi32 advapi32 comctl32 msvcrt kernel32 ntdll) add_cd_file(TARGET wordpad DESTINATION reactos/system32 FOR all) + +if(NOT MSVC) + allow_warnings(wordpad) +endif() diff --git a/reactos/base/applications/write/CMakeLists.txt b/reactos/base/applications/write/CMakeLists.txt index 48f6ff321af..943792268da 100644 --- a/reactos/base/applications/write/CMakeLists.txt +++ b/reactos/base/applications/write/CMakeLists.txt @@ -5,3 +5,7 @@ add_executable(write write.c rsrc.rc) set_module_type(write win32gui UNICODE) add_importlibs(write user32 gdi32 msvcrt kernel32) add_cd_file(TARGET write DESTINATION reactos/system32 FOR all) + +if(NOT MSVC) + allow_warnings(write) +endif() diff --git a/reactos/cmake/gcc.cmake b/reactos/cmake/gcc.cmake index 4149b5dd1a5..05b9ee6f458 100644 --- a/reactos/cmake/gcc.cmake +++ b/reactos/cmake/gcc.cmake @@ -5,6 +5,9 @@ add_compile_flags("-pipe -fms-extensions") # Debugging (Note: DWARF-4 on 4.5.1 when we ship) add_compile_flags("-gdwarf-2 -g2 -femit-struct-debug-detailed=none -feliminate-unused-debug-types") +# Do not allow warnings +add_compile_flags("-Werror") + # For some reason, cmake sets -fPIC, and we don't want it string(REPLACE "-fPIC" "" CMAKE_SHARED_LIBRARY_ASM_FLAGS ${CMAKE_SHARED_LIBRARY_ASM_FLAGS}) @@ -349,3 +352,7 @@ function(CreateBootSectorTarget2 _target_name _asm_file _binary_file _base_addre add_custom_target(${_target_name} ALL DEPENDS ${_binary_file}) endfunction() + +function(allow_warnings __module) + add_target_compile_flags(${__module} -Wno-error) +endfunction() diff --git a/reactos/dll/3rdparty/libtiff/CMakeLists.txt b/reactos/dll/3rdparty/libtiff/CMakeLists.txt index a83ca57ebd5..315e039b61b 100644 --- a/reactos/dll/3rdparty/libtiff/CMakeLists.txt +++ b/reactos/dll/3rdparty/libtiff/CMakeLists.txt @@ -50,8 +50,12 @@ add_library(libtiff SHARED tif_write.c tif_zip.c) -set_entrypoint(libtiff 0) +set_module_type(libtiff win32dll ENTRYPOINT 0) target_link_libraries(libtiff zlib getopt) add_importlibs(libtiff user32 msvcrt kernel32) add_dependencies(libtiff psdk) add_cd_file(TARGET libtiff DESTINATION reactos/system32 FOR all) + +if(NOT MSVC) + allow_warnings(libtiff) +endif() diff --git a/reactos/dll/3rdparty/libxslt/CMakeLists.txt b/reactos/dll/3rdparty/libxslt/CMakeLists.txt index 10df37c5b02..e90c979763c 100644 --- a/reactos/dll/3rdparty/libxslt/CMakeLists.txt +++ b/reactos/dll/3rdparty/libxslt/CMakeLists.txt @@ -44,3 +44,7 @@ endif() add_dependencies(libxslt psdk) add_pch(libxslt libxslt.h) add_cd_file(TARGET libxslt DESTINATION reactos/system32 FOR all) + +if(NOT MSVC) + allow_warnings(libxslt) +endif() diff --git a/reactos/dll/3rdparty/mesa32/CMakeLists.txt b/reactos/dll/3rdparty/mesa32/CMakeLists.txt index 32cf70fc86c..caf5bbcec49 100644 --- a/reactos/dll/3rdparty/mesa32/CMakeLists.txt +++ b/reactos/dll/3rdparty/mesa32/CMakeLists.txt @@ -260,7 +260,11 @@ endif() add_library(mesa32 SHARED ${SOURCE}) add_pch(mesa32 src/main/glheader.h) -set_entrypoint(mesa32 0) +set_module_type(mesa32 win32dll ENTRYPOINT 0) add_importlibs(mesa32 gdi32 user32 msvcrt kernel32 ntdll) add_dependencies(mesa32 psdk) add_cd_file(TARGET mesa32 DESTINATION reactos/system32 FOR all) + +if(NOT MSVC) + allow_warnings(mesa32) +endif() diff --git a/reactos/dll/directx/quartz/CMakeLists.txt b/reactos/dll/directx/quartz/CMakeLists.txt index aff19556112..aa1c426b924 100644 --- a/reactos/dll/directx/quartz/CMakeLists.txt +++ b/reactos/dll/directx/quartz/CMakeLists.txt @@ -72,3 +72,7 @@ add_importlibs(quartz add_pch(quartz quartz_private.h) add_cd_file(TARGET quartz DESTINATION reactos/system32 FOR all) + +if(NOT MSVC) + allow_warnings(quartz) +endif() diff --git a/reactos/dll/directx/wine/wined3d/CMakeLists.txt b/reactos/dll/directx/wine/wined3d/CMakeLists.txt index a7b742b28ed..dc5fd3cfdbf 100644 --- a/reactos/dll/directx/wine/wined3d/CMakeLists.txt +++ b/reactos/dll/directx/wine/wined3d/CMakeLists.txt @@ -70,3 +70,7 @@ add_dependencies(wined3d wineheaders) add_pch(wined3d wined3d_private.h) add_cd_file(TARGET wined3d DESTINATION reactos/system32 FOR all) add_importlib_target(wined3d.spec) + +if(NOT MSVC) + allow_warnings(wined3d) +endif() diff --git a/reactos/dll/win32/cabinet/CMakeLists.txt b/reactos/dll/win32/cabinet/CMakeLists.txt index f576efd211b..e90ef01ac4c 100644 --- a/reactos/dll/win32/cabinet/CMakeLists.txt +++ b/reactos/dll/win32/cabinet/CMakeLists.txt @@ -15,7 +15,7 @@ list(APPEND SOURCE add_library(cabinet SHARED ${SOURCE}) -set_entrypoint(cabinet 0) +set_module_type(cabinet win32dll ENTRYPOINT 0) target_link_libraries(cabinet wine) add_importlibs(cabinet kernel32 ntdll) add_importlib_target(cabinet.spec) diff --git a/reactos/dll/win32/itss/CMakeLists.txt b/reactos/dll/win32/itss/CMakeLists.txt index 188c2c37784..6e107078d90 100644 --- a/reactos/dll/win32/itss/CMakeLists.txt +++ b/reactos/dll/win32/itss/CMakeLists.txt @@ -24,6 +24,8 @@ set_module_type(itss win32dll) target_link_libraries(itss uuid wine) if(MSVC) target_link_libraries(itss itss_guid) +else() + allow_warnings(itss) endif() add_importlibs(itss diff --git a/reactos/dll/win32/jscript/CMakeLists.txt b/reactos/dll/win32/jscript/CMakeLists.txt index d346e64a206..b4d48696e18 100644 --- a/reactos/dll/win32/jscript/CMakeLists.txt +++ b/reactos/dll/win32/jscript/CMakeLists.txt @@ -62,3 +62,7 @@ add_importlibs(jscript add_pch(jscript jscript.h) add_dependencies(jscript jsglobal) add_cd_file(TARGET jscript DESTINATION reactos/system32 FOR all) + +if(NOT MSVC) + allow_warnings(jscript) +endif() diff --git a/reactos/dll/win32/localspl/CMakeLists.txt b/reactos/dll/win32/localspl/CMakeLists.txt index 5ce1b18826f..08808d0c55a 100644 --- a/reactos/dll/win32/localspl/CMakeLists.txt +++ b/reactos/dll/win32/localspl/CMakeLists.txt @@ -33,3 +33,7 @@ add_importlibs(localspl ntdll) add_cd_file(TARGET localspl DESTINATION reactos/system32 FOR all) + +if(NOT MSVC) + allow_warnings(localspl) +endif() diff --git a/reactos/dll/win32/mciseq/CMakeLists.txt b/reactos/dll/win32/mciseq/CMakeLists.txt index b6bba6b8e18..5b9fc45467a 100644 --- a/reactos/dll/win32/mciseq/CMakeLists.txt +++ b/reactos/dll/win32/mciseq/CMakeLists.txt @@ -10,8 +10,13 @@ list(APPEND SOURCE add_library(mciseq SHARED ${SOURCE}) -set_entrypoint(mciseq 0) +set_module_type(mciseq win32dll ENTRYPOINT 0) + target_link_libraries(mciseq wine) add_importlibs(mciseq winmm user32 kernel32 ntdll msvcrt) add_dependencies(mciseq psdk) add_cd_file(TARGET mciseq DESTINATION reactos/system32 FOR all) + +if(NOT MSVC) + allow_warnings(mciseq) +endif() diff --git a/reactos/dll/win32/mciwave/CMakeLists.txt b/reactos/dll/win32/mciwave/CMakeLists.txt index 48e6d5af48a..8a29a83caaa 100644 --- a/reactos/dll/win32/mciwave/CMakeLists.txt +++ b/reactos/dll/win32/mciwave/CMakeLists.txt @@ -13,8 +13,13 @@ list(APPEND SOURCE add_library(mciwave SHARED ${SOURCE}) -set_entrypoint(mciwave 0) +set_module_type(mciwave win32dll ENTRYPOINT 0) + target_link_libraries(mciwave wine) add_importlibs(mciwave user32 winmm msvcrt kernel32 ntdll) add_dependencies(mciwave psdk) add_cd_file(TARGET mciwave DESTINATION reactos/system32 FOR all) + +if(NOT MSVC) + allow_warnings(mciwave) +endif() diff --git a/reactos/dll/win32/rpcrt4/CMakeLists.txt b/reactos/dll/win32/rpcrt4/CMakeLists.txt index 46a2b70e57d..2f9d2d89754 100644 --- a/reactos/dll/win32/rpcrt4/CMakeLists.txt +++ b/reactos/dll/win32/rpcrt4/CMakeLists.txt @@ -50,3 +50,7 @@ add_delay_importlibs(rpcrt4 iphlpapi wininet secur32 user32) add_importlibs(rpcrt4 msvcrt advapi32 ws2_32 kernel32 ntdll) add_cd_file(TARGET rpcrt4 DESTINATION reactos/system32 FOR all) add_importlib_target(rpcrt4.spec) + +if(NOT MSVC) + allow_warnings(rpcrt4) +endif() diff --git a/reactos/dll/win32/shdocvw/CMakeLists.txt b/reactos/dll/win32/shdocvw/CMakeLists.txt index 1ad12e9f24e..1be4704b551 100644 --- a/reactos/dll/win32/shdocvw/CMakeLists.txt +++ b/reactos/dll/win32/shdocvw/CMakeLists.txt @@ -53,3 +53,7 @@ add_dependencies(shdocvw shdocvw_v1) add_pch(shdocvw shdocvw.h) add_cd_file(TARGET shdocvw DESTINATION reactos/system32 FOR all) add_importlib_target(shdocvw.spec) + +if(NOT MSVC) + allow_warnings(shdocvw) +endif() diff --git a/reactos/dll/win32/winhttp/CMakeLists.txt b/reactos/dll/win32/winhttp/CMakeLists.txt index 33777f232e5..dd2250be5e9 100644 --- a/reactos/dll/win32/winhttp/CMakeLists.txt +++ b/reactos/dll/win32/winhttp/CMakeLists.txt @@ -22,3 +22,7 @@ add_delay_importlibs(winhttp crypt32) add_importlibs(winhttp shlwapi wininet ws2_32 msvcrt advapi32 kernel32 ntdll) add_importlib_target(winhttp.spec) add_cd_file(TARGET winhttp DESTINATION reactos/system32 FOR all) + +if(NOT MSVC) + allow_warnings(winhttp) +endif() diff --git a/reactos/dll/win32/wininet/CMakeLists.txt b/reactos/dll/win32/wininet/CMakeLists.txt index 865ef7014a9..6ba338ecbbd 100644 --- a/reactos/dll/win32/wininet/CMakeLists.txt +++ b/reactos/dll/win32/wininet/CMakeLists.txt @@ -34,3 +34,7 @@ add_delay_importlibs(wininet secur32 crypt32) add_importlibs(wininet mpr shlwapi shell32 user32 advapi32 ws2_32 msvcrt kernel32 ntdll) add_cd_file(TARGET wininet DESTINATION reactos/system32 FOR all) add_importlib_target(wininet.spec) + +if(NOT MSVC) + allow_warnings(wininet) +endif() diff --git a/reactos/lib/3rdparty/libxml2/CMakeLists.txt b/reactos/lib/3rdparty/libxml2/CMakeLists.txt index 39ed9e74ab1..8d18f18d0f9 100644 --- a/reactos/lib/3rdparty/libxml2/CMakeLists.txt +++ b/reactos/lib/3rdparty/libxml2/CMakeLists.txt @@ -59,3 +59,7 @@ list(APPEND SOURCE add_library(libxml2 ${SOURCE}) target_link_libraries(libxml2 oldnames) add_dependencies(libxml2 psdk) + +if(NOT MSVC) + allow_warnings(libxml2) +endif() diff --git a/reactos/lib/drivers/lwip/CMakeLists.txt b/reactos/lib/drivers/lwip/CMakeLists.txt index e7e0e28cbb7..26c4594bfce 100644 --- a/reactos/lib/drivers/lwip/CMakeLists.txt +++ b/reactos/lib/drivers/lwip/CMakeLists.txt @@ -58,3 +58,6 @@ list(APPEND SOURCE add_library(lwip ${SOURCE}) add_dependencies(lwip bugcodes) +if(NOT MSVC) + allow_warnings(lwip) +endif() diff --git a/reactos/lib/rossym_new/CMakeLists.txt b/reactos/lib/rossym_new/CMakeLists.txt index 0a63d5b3ca3..3fa6f717030 100644 --- a/reactos/lib/rossym_new/CMakeLists.txt +++ b/reactos/lib/rossym_new/CMakeLists.txt @@ -22,4 +22,5 @@ else() add_library(rossym ${SOURCE}) add_pch(rossym precomp.h) add_dependencies(rossym psdk bugcodes) + allow_warnings(rossym) endif() diff --git a/reactos/lib/sdk/crt/msvcrtex.cmake b/reactos/lib/sdk/crt/msvcrtex.cmake index 9bc5dd0e47d..1ce79e18973 100644 --- a/reactos/lib/sdk/crt/msvcrtex.cmake +++ b/reactos/lib/sdk/crt/msvcrtex.cmake @@ -68,6 +68,7 @@ set_source_files_properties(startup/crtdll.c PROPERTIES COMPILE_DEFINITIONS CRTD if(NOT MSVC) target_link_libraries(msvcrtex oldnames) + allow_warnings(msvcrtex) endif() add_dependencies(msvcrtex psdk asm) -- 2.17.1