The command line macro definitions of the build utility do not end up in the Makefile for .c/.cpp
We know from the manual that build takes a set of macros (option -D). But after generating the Makefile for the .c/.cpp modules, for some reason these macros do not end up in the Makefile.
Do you mean all the -D macro are not generated into Makefile? Could you show me your build command and the incorrect Makefile?
Demo project: HelloWorldPkg.zip
All I want to do is pull the macro definition (-D) from the build command:
build -a X64 -p HelloWorldPkg\Hello.dsc -t VS2019 -D TEST=1
And use it in the code like this:
EFI_STATUS EFIAPI UefiEntryPoint(IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE* SystemTable)
{
#if defined(TEST)
Print (L"Test macro\n");
#endif
return EFI_SUCCESS;
}
But after generating the Makefile, for some reason the macro defined with -D does not get into CC_FLAGS:
CC_FLAGS = /nologo /c /WX /GS- /W4 /Gs32768 /D UNICODE /O1b2s /GL /Gy /FIAutoGen.h /EHs-c- /GR- /GF /Z7 /Gw
CC = C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\bin\Hostx86\x64\cl.exe
I wanted it that way:
CC_FLAGS = /nologo /c /WX /GS- /W4 /Gs32768 /D UNICODE /O1b2s /GL /Gy /FIAutoGen.h /EHs-c- /GR- /GF /Z7 /Gw /D TEST=1
CC = C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\bin\Hostx86\x64\cl.exe
Any progress?