Hi Gerd,

Thanks for your effort!

Sorry, but I *really* dislike this “BASETOOLS” notion. There might be external 
tools that also want to use the header (like we do with AUDK) and also edk2 
supports host-based unit tests. Imo the macro name should be generic, like 
“HOST_OS” or “USERLAND” or something (I’m bad with names :) ).

Speaking of host-based unit tests, why are they not affected by the issue?

Best regards,
Marvin

> On 14. Apr 2023, at 10:03, Gerd Hoffmann <kra...@redhat.com> wrote:
> 
> Allows for BaseTools-specific tweaks in include files.
> 
> Signed-off-by: Gerd Hoffmann <kra...@redhat.com>
> ---
> BaseTools/Source/C/Makefiles/header.makefile | 3 +++
> BaseTools/Source/C/Makefiles/ms.common       | 4 ++--
> BaseTools/Source/C/VfrCompile/GNUmakefile    | 1 +
> 3 files changed, 6 insertions(+), 2 deletions(-)
> 
> diff --git a/BaseTools/Source/C/Makefiles/header.makefile 
> b/BaseTools/Source/C/Makefiles/header.makefile
> index 1bf003523baf..6b743fa297b0 100644
> --- a/BaseTools/Source/C/Makefiles/header.makefile
> +++ b/BaseTools/Source/C/Makefiles/header.makefile
> @@ -124,6 +124,9 @@ ifeq ($(DARWIN),Darwin)
> endif
> endif
> 
> +CFLAGS   += -D BASETOOLS=1
> +CXXFLAGS += -D BASETOOLS=1
> +
> # keep BUILD_OPTFLAGS last
> CFLAGS   += $(BUILD_OPTFLAGS)
> CXXFLAGS += $(BUILD_OPTFLAGS)
> diff --git a/BaseTools/Source/C/Makefiles/ms.common 
> b/BaseTools/Source/C/Makefiles/ms.common
> index 8391f10d5dd2..6fc4c6477847 100644
> --- a/BaseTools/Source/C/Makefiles/ms.common
> +++ b/BaseTools/Source/C/Makefiles/ms.common
> @@ -57,5 +57,5 @@ LINKER = $(LD)
> 
> INC = $(INC) -I . -I $(SOURCE_PATH)\Include -I $(ARCH_INCLUDE) -I 
> $(SOURCE_PATH)\Common
> 
> -CFLAGS = $(CFLAGS) /nologo /Z7 /c /O2 /MT /W4 /WX /D 
> _CRT_SECURE_NO_DEPRECATE /D _CRT_NONSTDC_NO_DEPRECATE
> -CPPFLAGS = $(CPPFLAGS) /EHsc /nologo /Z7 /c /O2 /MT /D 
> _CRT_SECURE_NO_DEPRECATE /D _CRT_NONSTDC_NO_DEPRECATE
> +CFLAGS = $(CFLAGS) /nologo /Z7 /c /O2 /MT /W4 /WX /D 
> _CRT_SECURE_NO_DEPRECATE /D _CRT_NONSTDC_NO_DEPRECATE /D BASETOOLS
> +CPPFLAGS = $(CPPFLAGS) /EHsc /nologo /Z7 /c /O2 /MT /D 
> _CRT_SECURE_NO_DEPRECATE /D _CRT_NONSTDC_NO_DEPRECATE /D BASETOOLS
> diff --git a/BaseTools/Source/C/VfrCompile/GNUmakefile 
> b/BaseTools/Source/C/VfrCompile/GNUmakefile
> index 7d5976649dba..f1abed11376e 100644
> --- a/BaseTools/Source/C/VfrCompile/GNUmakefile
> +++ b/BaseTools/Source/C/VfrCompile/GNUmakefile
> @@ -24,6 +24,7 @@ VFR_CPPFLAGS = -DPCCTS_USE_NAMESPACE_STD $(CPPFLAGS)
> endif
> # keep BUILD_OPTFLAGS last
> VFR_CXXFLAGS = $(BUILD_OPTFLAGS)
> +VFR_CXXFLAGS += -D BASETOOLS=1
> 
> # keep EXTRA_LDFLAGS last
> VFR_LFLAGS = $(EXTRA_LDFLAGS)
> -- 
> 2.39.2
> 



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#103000): https://edk2.groups.io/g/devel/message/103000
Mute This Topic: https://groups.io/mt/98257896/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-


Reply via email to