Re: Custom build flags per FileNode using AddPreAction

Hua Yanghao <[email protected]>
Newsgroups gmane.comp.programming.tools.scons.user
Message-ID <CAPTzt1Aqi=O2CYE6Er75G+501M6S_L=j11HBnd7NkJqvNLvmcQ@mail.gmail.com>
On Wed, Apr 17, 2019 at 1:20 PM 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().
>
>
I use something like this:
old_cflags = env['CFLAGS']
obj = Object(file_path, CFLAGS = old_cflags + flags) # flags is what user
provided in module definition file like below.

The user interface (module definition) looks like this:
flags = ["-DABC", ...]
usw_flags('CFLAGS', flags)
usw_files("elf_obj", ["file1.c", "file2.c", ...])

-- Yanghao

_______________________________________________
Scons-users mailing list
[email protected]
https://pairlist4.pair.net/mailman/listinfo/scons-users
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.