Re: persistent but local tweaks to a node's environment
Mats Wichmann <[email protected]>
| Newsgroups | gmane.comp.programming.tools.scons.user |
|---|---|
| Message-ID | <[email protected]> |
On 8/1/21 3:04 PM, Gabe Black wrote: > > > On Sun, Aug 1, 2021 at 12:20 PM Bill Deegan <[email protected] > <mailto:[email protected]>> wrote: > > So at the time you call StaticObject(), for example, do you know > what flags are needed for that source? > > > No, I know what *extra* flags are needed for that source, not what those > flags will be added to. For instance I know I need to disable a warning > because of an unavoidable local false positive, but not to enable debug > information, or turn up optimizations. I'm probably missing something here, but you can query this - the env works like a dict. So for example, you can do something like: flags = env.get('CPPDEFINES', []) env.Program(CPPDEFINES = flags + ['FOO']) the problem is it's not absolutely guaranteed what datatype you'll get back when fetching a construction var, because SCons is flexible enough it will just take whatever you give it (Pythonically), but in some special cases it might do conversions behind the scenes. In fact, CPPDEFINES is special-cased if you do Append on it, but not if you access it directly. I'm not sure this cleverness is entirely helpful. _______________________________________________ Scons-users mailing list [email protected] https://pairlist4.pair.net/mailman/listinfo/scons-users