[PATCH] wscript: Add post-build processing support

Gedare Bloom gedare at rtems.org
Thu Mar 4 16:24:42 UTC 2021


Can you explain this a bit more? What is the need this solves, and how
will it be used?

On Thu, Mar 4, 2021 at 9:18 AM Kinsey Moore <kinsey.moore at oarcorp.com> wrote:
>
> This allows packaging of the compiled binaries to occur automatically
> and be bundled with other scripts and build items as convenient.
> ---
>  wscript | 22 ++++++++++++++++++++++
>  1 file changed, 22 insertions(+)
>
> diff --git a/wscript b/wscript
> index 6626fafb74..e263681716 100755
> --- a/wscript
> +++ b/wscript
> @@ -223,6 +223,12 @@ class Item(object):
>                  p.build(bld, bic)
>              self.do_build(bld, bic)
>
> +    def post_build(self, bld, bic):
> +        if _is_enabled(bld.env.ENABLE, self.get_enabled_by()):
> +            for p in self.links():
> +                p.post_build(bld, bic)
> +            self.do_post_build(bld, bic)
> +
>      def do_defaults(self, variant):
>          return
>
> @@ -238,6 +244,9 @@ class Item(object):
>      def do_build(self, bld, bic):
>          return
>
> +    def do_post_build(self, bld, bic):
> +        return
> +
>      def substitute(self, ctx, value):
>          if isinstance(value, str):
>              try:
> @@ -1074,6 +1083,15 @@ class ScriptItem(Item):
>          if script:
>              exec(script)
>
> +    def do_post_build(self, bld, bic):
> +        script = False
> +        try:
> +            script = self.data["do-post-build"]
> +        except KeyError:
> +            pass
> +        if script:
> +            exec(script)
> +
>
>  class ConfigItemContext(object):
>      def __init__(self, cp, path_list):
> @@ -1485,6 +1503,10 @@ def build(bld):
>      bsps[bld.env.ARCH][bld.env.BSP_BASE].build(bld, bic)
>      items[bld.env.TOPGROUP].build(bld, bic)
>
> +    def post_build(bld):
> +        bsps[bld.env.ARCH][bld.env.BSP_BASE].post_build(bld, bic)
> +    bld.add_post_fun(post_build)
> +
>
>  def add_log_filter(name):
>      msg = "'" + name + "' finished successfully"
> --
> 2.20.1
>
> _______________________________________________
> devel mailing list
> devel at rtems.org
> http://lists.rtems.org/mailman/listinfo/devel


More information about the devel mailing list