From 6a6672d029c7f412d6b11769c0f4d9702f2f523d Mon Sep 17 00:00:00 2001 From: Joachim Henze Date: Thu, 17 Dec 2020 13:36:20 +0100 Subject: [PATCH] [0.4.14][APISETS][RDBSSLIB][RTL][DISK_NEW] Fix all build issues for MSVC Rls-config CORE-17402 Allows to complete the whole 'ninja bootcd' after 'configure -DCMAKE_BUILD_TYPE=Release' for compiler MSVC 2010SP1 16.0.40219.1 with RosBE 2.1.6 Similar to the fix committed in 0.4.15-dev-1453-g 4ad7b6d --- dll/apisets/CMakeLists.txt | 2 +- dll/apisets/CMakeLists.txt.in | 2 +- drivers/storage/class/disk_new/CMakeLists.txt | 8 +++++++- sdk/lib/drivers/rdbsslib/CMakeLists.txt | 5 +++++ sdk/lib/rtl/CMakeLists.txt | 8 +++++++- 5 files changed, 21 insertions(+), 4 deletions(-) diff --git a/dll/apisets/CMakeLists.txt b/dll/apisets/CMakeLists.txt index 27b82d2a281..71b956cd40e 100644 --- a/dll/apisets/CMakeLists.txt +++ b/dll/apisets/CMakeLists.txt @@ -27,7 +27,7 @@ function (add_apiset apiset_name baseaddress) if(NOT MSVC) target_compile_options(${apiset_name} PRIVATE -fno-builtin) else() - target_compile_options(${apiset_name} PRIVATE /wd4026 /wd4273) + target_compile_options(${apiset_name} PRIVATE /wd4026 /wd4273 /Oi-) endif() add_importlibs(${apiset_name} ${ARGN} ntdll) diff --git a/dll/apisets/CMakeLists.txt.in b/dll/apisets/CMakeLists.txt.in index 69aaa9fa38d..da18cb48fbc 100644 --- a/dll/apisets/CMakeLists.txt.in +++ b/dll/apisets/CMakeLists.txt.in @@ -27,7 +27,7 @@ function (add_apiset apiset_name baseaddress) if(NOT MSVC) target_compile_options(${apiset_name} PRIVATE -fno-builtin) else() - target_compile_options(${apiset_name} PRIVATE /wd4026 /wd4273) + target_compile_options(${apiset_name} PRIVATE /wd4026 /wd4273 /Oi-) endif() add_importlibs(${apiset_name} ${ARGN} ntdll) diff --git a/drivers/storage/class/disk_new/CMakeLists.txt b/drivers/storage/class/disk_new/CMakeLists.txt index 252f6735ff2..52228a7b4ef 100644 --- a/drivers/storage/class/disk_new/CMakeLists.txt +++ b/drivers/storage/class/disk_new/CMakeLists.txt @@ -1,6 +1,11 @@ include_directories(..) +if(MSVC) + # error C4101: 'ntNameBuffer' : unreferenced local variable in Release Configuration due to logging + replace_compile_flags("/we4101" " ") +endif() + list(APPEND SOURCE data.c disk.c @@ -20,5 +25,6 @@ endif() set_module_type(disk_new kernelmodedriver) add_importlibs(disk_new classpnp ntoskrnl hal) -add_pch(disk_new disk.h SOURCE) +#disable pch to prevent redefinition of _WIN32_WINNT, DiskReadDriveCapacity and DiskGetDetectInfo in Release-Config +#add_pch(disk_new disk.h SOURCE) add_cd_file(TARGET disk_new DESTINATION reactos/system32/drivers NO_CAB FOR all) diff --git a/sdk/lib/drivers/rdbsslib/CMakeLists.txt b/sdk/lib/drivers/rdbsslib/CMakeLists.txt index 7b6ec545500..56ab772675d 100644 --- a/sdk/lib/drivers/rdbsslib/CMakeLists.txt +++ b/sdk/lib/drivers/rdbsslib/CMakeLists.txt @@ -3,6 +3,11 @@ add_definitions(-DUNICODE -D_UNICODE -DRDBSS_TRACKER) include_directories(${REACTOS_SOURCE_DIR}/drivers/filesystems/mup ${REACTOS_SOURCE_DIR}/sdk/lib/drivers/copysup) +if(MSVC) + # error C4101: 'BreakpointsSave' : unreferenced local variable in Release-Configuration + replace_compile_flags("/we4101" " ") +endif() + list(APPEND SOURCE rdbss.c) diff --git a/sdk/lib/rtl/CMakeLists.txt b/sdk/lib/rtl/CMakeLists.txt index 573e4c08026..c734486901b 100644 --- a/sdk/lib/rtl/CMakeLists.txt +++ b/sdk/lib/rtl/CMakeLists.txt @@ -5,6 +5,11 @@ add_definitions( -D_NTSYSTEM_ -D_NTDLLBUILD_) +if(MSVC) + # error C4101: unreferenced local variable in Release-Configuration due to debug logging + replace_compile_flags("/we4101" " ") +endif() + list(APPEND SOURCE access.c acl.c @@ -112,5 +117,6 @@ endif() add_asm_files(rtl_asm ${ASM_SOURCE}) add_library(rtl ${SOURCE} ${rtl_asm}) -add_pch(rtl rtl.h SOURCE) +#disable pch to prevent macro redefinition rtl.h WIN32_NO_STATUS +#add_pch(rtl rtl.h SOURCE) add_dependencies(rtl psdk asm)