From: "Ashish Singhal" <ashishsingha@nvidia.com>
To: "Lin, Derek (HPS SW)" <derek.lin2@hpe.com>,
"devel@edk2.groups.io" <devel@edk2.groups.io>,
Bob Feng <bob.c.feng@intel.com>,
"Gao, Liming" <liming.gao@intel.com>
Subject: Re: [edk2-devel] Conditionally Include FDF File
Date: Mon, 20 Apr 2020 07:42:03 +0000 [thread overview]
Message-ID: <BYAPR12MB27265EA79761EBA258476A25BAD40@BYAPR12MB2726.namprd12.prod.outlook.com> (raw)
In-Reply-To: <BYAPR12MB272627241ED20FC05BDFB9BEBAD40@BYAPR12MB2726.namprd12.prod.outlook.com>
[-- Attachment #1: Type: text/plain, Size: 2356 bytes --]
Spoke to soon. My change works for the case where BUILD_PLATFORM_XYZ is not defined but the case where it is defined I guess INCLUDE_XYZ_FDF needs to be defined in a different way with proper escape characters.
Thanks
Ashish
________________________________
From: Ashish Singhal <ashishsingha@nvidia.com>
Sent: Monday, April 20, 2020 1:07 AM
To: Lin, Derek (HPS SW) <derek.lin2@hpe.com>; devel@edk2.groups.io <devel@edk2.groups.io>; Bob Feng <bob.c.feng@intel.com>; Gao, Liming <liming.gao@intel.com>
Subject: Re: [edk2-devel] Conditionally Include FDF File
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.lin2@hpe.com>
Sent: Monday, April 20, 2020 12:16 AM
To: Ashish Singhal <ashishsingha@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.
-----------------------------------------------------------------------------------
[-- Attachment #2: Type: text/html, Size: 7680 bytes --]
next prev parent reply other threads:[~2020-04-20 7:42 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-04-20 5:25 Conditionally Include FDF File Ashish Singhal
2020-04-20 6:16 ` [edk2-devel] " Lin, Derek (HPS SW)
2020-04-20 7:07 ` Ashish Singhal
2020-04-20 7:42 ` Ashish Singhal [this message]
2020-04-20 12:05 ` Laszlo Ersek
2020-04-20 16:33 ` Ashish Singhal
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-list from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=BYAPR12MB27265EA79761EBA258476A25BAD40@BYAPR12MB2726.namprd12.prod.outlook.com \
--to=devel@edk2.groups.io \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox