It seems like this is happening because in FdfParser.py, include files are 
processed before processing the conditional statements. I think this is being 
done so that all defines (even from the included files) can be accounted for 
before processing any conditionals. This seems to be a valid flow from 
pre-processing perspective, although this leaves out the use case where a file 
may be conditionally included.

Bob/Liming,

For now, I have fixed the issue by changing my conditional include to be the 
following:

In top-level FDF:
!ifdef $(BUILD_PLATFORM_XYZ)
  $(INCLUDE_XYZ_FDF)
!endif

In top-level DSC:
!ifdef $(BUILD_PLATFORM_XYZ)
  INCLUDE_XYZ_FDF = !include Platform/NVIDIA/XYZ.fdf.inc
!endif

Please suggest me if there is a batter way of working around this issue.

Thanks
Ashish
________________________________
From: Lin, Derek (HPS SW) <derek.l...@hpe.com>
Sent: Monday, April 20, 2020 12:16 AM
To: Ashish Singhal <ashishsin...@nvidia.com>; devel@edk2.groups.io 
<devel@edk2.groups.io>
Subject: Re: [edk2-devel] Conditionally Include FDF File

External email: Use caution opening links or attachments

I saw this issue too.

The included file is always included no matter the condition is TRUE or FALSE.
```
!if FALSE
  !include abc.fdf
!endif
```


-----------------------------------------------------------------------------------
This email message is for the sole use of the intended recipient(s) and may 
contain
confidential information.  Any unauthorized review, use, disclosure or 
distribution
is prohibited.  If you are not the intended recipient, please contact the 
sender by
reply email and destroy all copies of the original message.
-----------------------------------------------------------------------------------

-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#57599): https://edk2.groups.io/g/devel/message/57599
Mute This Topic: https://groups.io/mt/73143623/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to