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

ccollins 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 d254d7c  builder: Add build profile to the environment variables
d254d7c is described below

commit d254d7cc5019b42c0c773a06cfe0ec4a6f7ee44d
Author: Casper Meijn <cas...@meijn.net>
AuthorDate: Fri Oct 23 09:57:23 2020 +0200

    builder: Add build profile to the environment variables
---
 newt/builder/buildutil.go | 17 ++++++++++-------
 newt/builder/extcmd.go    | 15 ++++++++-------
 2 files changed, 18 insertions(+), 14 deletions(-)

diff --git a/newt/builder/buildutil.go b/newt/builder/buildutil.go
index 9fe2ecb..7bc83f6 100644
--- a/newt/builder/buildutil.go
+++ b/newt/builder/buildutil.go
@@ -247,13 +247,14 @@ func SlotEnvVars(bspPkg *pkg.BspPackage,
 }
 
 type UserEnvParams struct {
-       Lpkg       *pkg.LocalPackage
-       TargetName string // Short name
-       AppName    string
-       BuildName  string // "app" or "loader"
-       UserSrcDir string // "" if none
-       UserIncDir string // "" if none
-       WorkDir    string
+       Lpkg         *pkg.LocalPackage
+       TargetName   string // Short name
+       BuildProfile string
+       AppName      string
+       BuildName    string // "app" or "loader"
+       UserSrcDir   string // "" if none
+       UserIncDir   string // "" if none
+       WorkDir      string
 }
 
 // UserEnvVars calculates the set of environment variables required by external
@@ -279,6 +280,8 @@ func UserEnvVars(params UserEnvParams) map[string]string {
                m["MYNEWT_USER_INCLUDE_DIR"] = params.UserIncDir
        }
 
+       m["MYNEWT_BUILD_PROFILE"] = params.BuildProfile
+
        return m
 }
 
diff --git a/newt/builder/extcmd.go b/newt/builder/extcmd.go
index 4819dfe..3424cc0 100644
--- a/newt/builder/extcmd.go
+++ b/newt/builder/extcmd.go
@@ -112,13 +112,14 @@ func (t *TargetBuilder) envVarsForCmd(sf stage.StageFunc, 
userSrcDir string,
        }
 
        p := UserEnvParams{
-               Lpkg:       sf.Pkg,
-               TargetName: t.target.FullName(),
-               AppName:    t.appPkg.FullName(),
-               BuildName:  buildName,
-               UserSrcDir: userSrcDir,
-               UserIncDir: userIncDir,
-               WorkDir:    workDir,
+               Lpkg:         sf.Pkg,
+               TargetName:   t.target.FullName(),
+               BuildProfile: t.target.BuildProfile,
+               AppName:      t.appPkg.FullName(),
+               BuildName:    buildName,
+               UserSrcDir:   userSrcDir,
+               UserIncDir:   userIncDir,
+               WorkDir:      workDir,
        }
        uenv := UserEnvVars(p)
        for k, v := range uenv {

Reply via email to