From 78ded05547ca67fba11450ef5361e6f19788a31e Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Sun, 3 Nov 2024 16:59:19 +0200 Subject: [PATCH] [MINIHAL] Move the definition of _MINIHAL_ to directory scope This is required, so that the definition is available when preprocessing asm files on MSVC builds. Otherwise systimer.s will contain KeStallExecutionProcessor, which must not be used in freeldr. --- hal/halx86/minihal/CMakeLists.txt | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/hal/halx86/minihal/CMakeLists.txt b/hal/halx86/minihal/CMakeLists.txt index d446bf3cc7b..4a7ca0f9d89 100644 --- a/hal/halx86/minihal/CMakeLists.txt +++ b/hal/halx86/minihal/CMakeLists.txt @@ -1,4 +1,9 @@ +# We need to define this here, because the target definitions are not +# passed to CL, when preprocessing the asm files on MSVC builds. +# See CORE-19847 +add_definitions(-D_MINIHAL_) + list(APPEND MINI_HAL_SOURCE ../generic/portio.c ../legacy/bus/bushndlr.c @@ -39,6 +44,6 @@ endif() add_asm_files(mini_hal_asm ../generic/systimer.S) add_library(mini_hal ${MINI_HAL_SOURCE} ${mini_hal_asm}) -target_compile_definitions(mini_hal PRIVATE _MINIHAL_ _BLDR_ _NTSYSTEM_) +target_compile_definitions(mini_hal PRIVATE _BLDR_ _NTSYSTEM_) add_dependencies(mini_hal psdk bugcodes asm) add_pch(mini_hal ../include/hal.h MINI_HAL_SOURCE)