Repository: incubator-mynewt-newt Updated Branches: refs/heads/develop eedfe1b86 -> 05d40c264
define features at top-level build. 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/05d40c26 Tree: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/tree/05d40c26 Diff: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/diff/05d40c26 Branch: refs/heads/develop Commit: 05d40c264690edde880c469a7ed89f418cbd1d71 Parents: eedfe1b Author: Sterling Hughes <[email protected]> Authored: Tue Aug 2 11:45:16 2016 -0700 Committer: Sterling Hughes <[email protected]> Committed: Tue Aug 2 11:45:16 2016 -0700 ---------------------------------------------------------------------- newt/builder/build.go | 6 ++++++ 1 file changed, 6 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/05d40c26/newt/builder/build.go ---------------------------------------------------------------------- diff --git a/newt/builder/build.go b/newt/builder/build.go index 03d5706..b3dd222 100644 --- a/newt/builder/build.go +++ b/newt/builder/build.go @@ -399,6 +399,12 @@ func (b *Builder) PrepBuild() error { if err != nil { return err } + + // For every feature defined, generate a define and append it to cflags + for fname, _ := range b.Features() { + targetCi.Cflags = append(targetCi.Cflags, + fmt.Sprintf("-DFEATURE_%s", fname)) + } baseCi.AddCompilerInfo(targetCi) // App flags.
