[build2] Multiple patterns problem

Moldmann Max (DC-MH/ENG52-NA) Max.Moldmann at boschrexroth-us.com
Fri Sep 22 14:18:39 UTC 2017


Hi Boris,

I am trying the following with build2 0.7.0-a.0.67f920eafe224082

Imagine a project with five source folders a, b, c, foo, bar. To build it correctly I need to exclude foo and bar.

The following buildfile commands work:

$out_base/_bin/exe{myproject.elf}: {c}{** -{***/foo/** ***/bar/**}}

$out_base/_bin/exe{myproject.elf}: {c}{** -***/foo/** -***/bar/**}

$out_base/_bin/exe{myproject.elf}: {c}{a/** b/** c/** -***/foo/** -***/bar/**}


But this doesn't work:

$out_base/_bin/exe{myproject.elf}: {c}{a/** b/** c/** -{***/foo/** ***/bar/**}}

The error is:
buildfile:23:81: error: nested type name -


Would be nice if this works cause I am trying to use it like this:

$out_base/_bin/exe{myproject.elf}: {c}{{$include} -{$exclude}}

In order to feed in multiple include and exclude patterns via environment variables.
E.g.:
# Multiple exclude patterns
# (Split string into list and remove quotes [requires build2 v0.7-a.0])
exclude = $regex.split($getenv(BUILD2_EXCLUDE_PATTERN), ' *"([^"]*)" *', '\1')


Thanks,
Max
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.build2.org/archives/users/attachments/20170922/bd34b1a1/attachment.html>


More information about the users mailing list