Custom build flags per FileNode using AddPreAction
Ivan Kravets <[email protected]>
| Newsgroups | gmane.comp.programming.tools.scons.user |
|---|---|
| Message-ID | <[email protected]> |
Hi,
This is Ivan from PlatformIO.Org. Sometimes our users ask if it is possible to customize build flags per a source file which was previously added to a build process via Program() or StaticLibrary().
SCons has a useful AddPreAction mechanism and it works. For example,
```
def test(env, source, target):
print(type(source[0]))
env.AddPreAction("$BUILD_DIR/SomeLibrary/foo.cpp.o", test)
```
It will print:
```
<class 'SCons.Node.FS.File'>
```
So, it is possible to customize "foo.cpp" with extra flags (for example, some macro, etc) having `SCons.Node.FS.File`?
P.S: Similar what we can do with env.Object().
Thanks in advance!
Regards, Ivan.
_______________________________________________
Scons-users mailing list
[email protected]
https://pairlist4.pair.net/mailman/listinfo/scons-users