[build2] Multiple patterns problem
Moldmann Max (DC-MH/ENG52-NA)
Max.Moldmann at boschrexroth-us.com
Tue Oct 3 22:10:18 UTC 2017
Thanks Karen,
Awesome! That works!
Max
-----Original Message-----
From: Karen Arutyunov [mailto:karen at codesynthesis.com]
Sent: Tuesday, October 3, 2017 11:52 AM
To: Moldmann Max (DC-MH/ENG52-NA) <Max.Moldmann at boschrexroth-us.com>; users at build2.org
Subject: Re: [build2] Multiple patterns problem
Hi Max,
> 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/**}
The last example actually doesn't work as you expect. The second pattern doesn't start with +/-, so all 5 patterns are independent (see the manual for details).
> 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 -
Right, by the same reason -{***/foo/** ***/bar/**} is treated not as an exclusion group but as a regular one with an unexpected type.
> 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.
This wasn't possible at the time of your email, but it is now implemented. Just a syntax is a bit different (note the first group is an inclusion):
$out_base/_bin/exe{myproject.elf}: {c}{+{$include} -{$exclude}}
You can obtain the latest toolchain that supports the new feature from https://stage.build2.org/0/0.7.0-a.0/
The online manual is updated accordingly at https://build2.org/build2/doc/build2-build-system-manual.xhtml#name-patterns
Best regards,
Karen
More information about the users
mailing list