[PATCH v1 1/2] wscript: Allow defines to be used for substitution

Sebastian Huber sebastian.huber at embedded-brains.de
Wed Apr 13 05:53:58 UTC 2022


On 12/04/2022 20:55, Kinsey Moore wrote:
> This allows options set as defines to the compiler to be used as targets
> for substitution using the syntax ${DEFINES:define_target}. These need
> special handling since they are not in a form that is trivially consumed
> by the mapping code.
> ---
>   wscript | 4 ++++
>   1 file changed, 4 insertions(+)
> 
> diff --git a/wscript b/wscript
> index 4d63dbc66f..9de9d67b91 100755
> --- a/wscript
> +++ b/wscript
> @@ -107,6 +107,10 @@ class EnvWrapper(object):
>           except IndexError:
>               fmt = "{}"
>           if isinstance(v, list):
> +            if fields[0] == "DEFINES":
> +                for D in v:
> +                    if D.startswith(fields[1]+'='):
> +                        return "{}".format(D.split("=")[1].strip('"'))
>               return " ".join([fmt.format(w) for w in v])
>           return fmt.format(v)
>   

Sorry, I don't understand what this is supposed to do. Could you please 
give me an example use case?

-- 
embedded brains GmbH
Herr Sebastian HUBER
Dornierstr. 4
82178 Puchheim
Germany
email: sebastian.huber at embedded-brains.de
phone: +49-89-18 94 741 - 16
fax:   +49-89-18 94 741 - 08

Registergericht: Amtsgericht München
Registernummer: HRB 157899
Vertretungsberechtigte Geschäftsführer: Peter Rasmussen, Thomas Dörfler
Unsere Datenschutzerklärung finden Sie hier:
https://embedded-brains.de/datenschutzerklaerung/


More information about the devel mailing list