Re: Custom build flags per FileNode using AddPreAction
Bill Deegan <[email protected]>
| Newsgroups | gmane.comp.programming.tools.scons.user |
|---|---|
| Message-ID | <CAEyG4CH8SJOCxMWkm1u2pQ5T2RTVmStNy0UJuNJd2prUXX+D7A@mail.gmail.com> |
Not sure I understand. What do you mean by "build flags"? Do you mean items on the compile command line? Or something else? On Wed, Apr 17, 2019 at 4:20 AM Ivan Kravets <[email protected]> wrote: > 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 > _______________________________________________ Scons-users mailing list [email protected] https://pairlist4.pair.net/mailman/listinfo/scons-users