On May 6, 2013, at 8:08 AM, "Kinney, Michael D" <[email protected]> 
wrote:

> Mike,
>  
> When duplicate statements appear some sections, only the last statement in 
> the section is used.  I think you are seeing that behavior in your example.
>  

This brings up a general issue with the current scheme. It is not possible to 
use multiple lines. It would be nice to support some kind of multi-line syntax 
(maybe like C preprocessor). It would also be good if lines that are ignored 
would generate a warning of some kind. 

> In order to get all 3 flags appended, you need to do that in a single 
> statement in the section.  If you want to conditionally append DEBUG2 as 
> shown in your example, you might consider the following:
>  

To work around these limitations I've done stuff like this in the past. 

[Defines]
  DEFINE DEBUG_FLAGS = /D DEBUG1 /D DEBUG3

[BuildOptions]
!ifdef $(S2)
  MSFT:*_*_*_CC_FLAGS = $(DEBUG_FLAGS) /D DEBUG2
!else
  MSFT:*_*_*_CC_FLAGS = $(DEBUG_FLAGS)
!endif

> !ifdef $(S2)
>   MSFT:*_*_*_CC_FLAGS = /D DEBUG1 /D DEBUG2 /D DEBUG3
> !else
>   MSFT:*_*_*_CC_FLAGS = /D DEBUG1 /D DEBUG3
> !endif
> 
> Mike
>  
> From: Lee mike [mailto:[email protected]] 
> Sent: Monday, May 06, 2013 6:29 AM
> To: Andrew Fish
> Cc: [email protected]
> Subject: Re: [edk2-buildtools] Re-define element in [BuildOptions]
>  
> Hi Andrew,
>  
> Sorry for my unclear statement. I am seeing a way to append definitions in 
> the same section so that when I write
>  
> [BuildOptions]
>  MSFT:*_*_*_CC_FLAGS = /D DEBUG1
>  MSFT:*_*_*_CC_FLAGS = /D DEBUG2
>  MSFT:*_*_*_CC_FLAGS = /D DEBUG3
>  
> I need it to behave as 
>  MSFT:*_*_*_CC_FLAGS = /D DEBUG1 /D DEBUG2 /D DEBUG3
>  
> But I found it uses the last one only, which means it treats my code as
>  MSFT:*_*_*_CC_FLAGS = /D DEBUG3
>  
> My environment is Windows7/VS2008, building edk2/OvmfPkgX64 from 
> https://github.com/tianocore/edk2.git
> (git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@14323)
>  
> Thanks.
>  
> BR,
> Mike
>  
>  
> 
> 2013/5/6 Andrew Fish <[email protected]>
> 
> Andrew Fish
> 
> 
> 
> 
> 
> On May 4, 2013, at 11:18 PM, Lee mike <[email protected]> wrote:
> 
> > Hi,
> >
> > I wrote code to .dsc as below:
> >
> > [BuildOptions]
> >   MSFT:*_*_*_CC_FLAGS = /D DEBUG1
> >   MSFT:*_*_*_CC_FLAGS = /D DEBUG2
> >   MSFT:*_*_*_CC_FLAGS = /D DEBUG3
> >
> > The output makefile shows that build.exe (or something else in BaseTools) 
> > emits DEBUG3 only.
> >   CC_FLAGS = /nologo /FAcs /c /WX /GS- /W4 /Gs32768 /Gy /D UNICODE /O1ib2 
> > /GL /FIAutoGen.h /EHs-c- /GR- /GF /Zi /Gm /D DEBUG3
> >
> > Invoking build.exe with '-D S2' to the following code will certainly not 
> > generate DEBUG2 too.
> > [BuildOptions]
> >   MSFT:*_*_*_CC_FLAGS = /D DEBUG1
> > !ifdef $(S2)
> >   MSFT:*_*_*_CC_FLAGS = /D DEBUG2
> > !endif
> >   MSFT:*_*_*_CC_FLAGS = /D DEBUG3
> >
> > Any advice?
> >
> 
> The spec for the DSC file states:
> Two types of assignment operators are permitted, the single equal “=” sign is 
> used to append the string to the existing definition, while the double equal 
> “==” sign is used to override any previous definition, replacing the content 
> with just the string.
> 
> So it sounds like you are seeing == behavior? What happens when you use ==?
> 
> Thanks,
> 
> Andrew Fish
> 
> >
> > BR,
> > Mike
> >
> > ------------------------------------------------------------------------------
> > Get 100% visibility into Java/.NET code with AppDynamics Lite
> > It's a free troubleshooting tool designed for production
> > Get down to code-level detail for bottlenecks, with <2% overhead.
> > Download for free and get started troubleshooting in minutes.
> > http://p.sf.net/sfu/appdyn_d2d_ap2_______________________________________________
> > edk2-buildtools-devel mailing list
> > [email protected]
> > https://lists.sourceforge.net/lists/listinfo/edk2-buildtools-devel
> 

------------------------------------------------------------------------------
Introducing AppDynamics Lite, a free troubleshooting tool for Java/.NET
Get 100% visibility into your production application - at no cost.
Code-level diagnostics for performance bottlenecks with <2% overhead
Download for free and get started troubleshooting in minutes.
http://p.sf.net/sfu/appdyn_d2d_ap1
_______________________________________________
edk2-buildtools-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-buildtools-devel

Reply via email to