Repository: incubator-mynewt-newt
Updated Branches:
  refs/heads/0_10_0_dev 1a719361d -> eedfe1b86


newt - Don't gen .bin file if compiler forbids it.


Project: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/repo
Commit: 
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/commit/eedfe1b8
Tree: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/tree/eedfe1b8
Diff: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/diff/eedfe1b8

Branch: refs/heads/0_10_0_dev
Commit: eedfe1b862fa69c7fadc0c97bfde93b17a25818b
Parents: 1a71936
Author: Christopher Collins <[email protected]>
Authored: Thu Jul 28 12:44:00 2016 -0700
Committer: Christopher Collins <[email protected]>
Committed: Thu Jul 28 12:44:00 2016 -0700

----------------------------------------------------------------------
 newt/newtutil/newtutil.go  | 14 ++++++++++----
 newt/toolchain/compiler.go |  9 ++++++++-
 2 files changed, 18 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/eedfe1b8/newt/newtutil/newtutil.go
----------------------------------------------------------------------
diff --git a/newt/newtutil/newtutil.go b/newt/newtutil/newtutil.go
index 0daa992..0930029 100644
--- a/newt/newtutil/newtutil.go
+++ b/newt/newtutil/newtutil.go
@@ -59,23 +59,29 @@ func GetStringFeatures(v *viper.Viper, features 
map[string]bool,
        return strings.TrimSpace(val)
 }
 
-func GetBoolFeatures(v *viper.Viper, features map[string]bool,
-       key string) (bool, error) {
+func GetBoolFeaturesDflt(v *viper.Viper, features map[string]bool,
+       key string, dflt bool) (bool, error) {
 
        s := GetStringFeatures(v, features, key)
        if s == "" {
-               return false, nil
+               return dflt, nil
        }
 
        b, err := strconv.ParseBool(s)
        if err != nil {
-               return false, util.FmtNewtError("invalid bool value for %s: %s",
+               return dflt, util.FmtNewtError("invalid bool value for %s: %s",
                        key, s)
        }
 
        return b, nil
 }
 
+func GetBoolFeatures(v *viper.Viper, features map[string]bool,
+       key string) (bool, error) {
+
+       return GetBoolFeaturesDflt(v, features, key, false)
+}
+
 func GetStringSliceFeatures(v *viper.Viper, features map[string]bool,
        key string) []string {
 

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/eedfe1b8/newt/toolchain/compiler.go
----------------------------------------------------------------------
diff --git a/newt/toolchain/compiler.go b/newt/toolchain/compiler.go
index 5dc33e2..e44ff51 100644
--- a/newt/toolchain/compiler.go
+++ b/newt/toolchain/compiler.go
@@ -66,6 +66,7 @@ type Compiler struct {
        ocPath                string
        ldResolveCircularDeps bool
        ldMapFile             bool
+       ldBinFile             bool
        dstDir                string
 
        // The info to be applied during compilation.
@@ -234,6 +235,12 @@ func (c *Compiler) load(compilerDir string, buildProfile 
string) error {
                return err
        }
 
+       c.ldBinFile, err = newtutil.GetBoolFeaturesDflt(v, features,
+               "compiler.ld.binfile", true)
+       if err != nil {
+               return err
+       }
+
        if len(c.lclInfo.Cflags) == 0 {
                // Assume no Cflags implies an unsupported build profile.
                return util.FmtNewtError("Compiler doesn't support build 
profile "+
@@ -759,7 +766,7 @@ func (c *Compiler) PrintSize(elfFilename string) (string, 
error) {
 // @param objFiles              An array of the source .o and .a filenames.
 func (c *Compiler) CompileElf(binFile string, objFiles []string) error {
        options := map[string]bool{"mapFile": c.ldMapFile,
-               "listFile": true, "binFile": true}
+               "listFile": true, "binFile": c.ldBinFile}
 
        // Make sure the compiler package info is added to the global set.
        c.ensureLclInfoAdded()

Reply via email to