This is an automated email from the ASF dual-hosted git repository.

utzig pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mynewt-newt.git


The following commit(s) were added to refs/heads/master by this push:
     new db720bd  Add Cflags and Include paths to pre_build_cmds environment
db720bd is described below

commit db720bde8f92083cc4745495d779df4a99cf6a7e
Author: Casper Meijn <[email protected]>
AuthorDate: Sun Jul 5 09:11:56 2020 +0200

    Add Cflags and Include paths to pre_build_cmds environment
    
    Add the CFLAGS and INCLUDE_PATH as used by newt to the environment when
    starting a pre_build_cmd. I need this to execute rust bindgen correctly.
    This program will parse the mynewt headers and generate rust code from
    that and therefore it needs the correct c-flags and include paths.
---
 newt/builder/buildutil.go | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/newt/builder/buildutil.go b/newt/builder/buildutil.go
index 1687f62..9fe2ecb 100644
--- a/newt/builder/buildutil.go
+++ b/newt/builder/buildutil.go
@@ -315,5 +315,8 @@ func (b *Builder) EnvVars(imageSlot int) 
(map[string]string, error) {
                env[k] = v
        }
 
+       env["MYNEWT_INCLUDE_PATH"] = strings.Join(b.compilerInfo.Includes, ":")
+       env["MYNEWT_CFLAGS"] = strings.Join(b.compilerInfo.Cflags, " ")
+
        return env, nil
 }

Reply via email to