You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by na...@apache.org on 2020/05/04 07:56:45 UTC

[mynewt-newt] branch master updated: Add include_dirs setting to syscfg

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

naraj 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 b86d086  Add include_dirs setting to syscfg
b86d086 is described below

commit b86d0867c01746631699eb589c8ec27567e4e0f3
Author: MichaƂ Narajowski <mi...@codecoup.pl>
AuthorDate: Thu Apr 30 10:27:12 2020 +0200

    Add include_dirs setting to syscfg
    
    Allows to specify directories to include in an external SDK
    that does not follow the convention used by Newt of putting
    everything under "src/ext/".
---
 newt/builder/buildpackage.go | 15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)

diff --git a/newt/builder/buildpackage.go b/newt/builder/buildpackage.go
index 750c1d7..7fb267c 100644
--- a/newt/builder/buildpackage.go
+++ b/newt/builder/buildpackage.go
@@ -102,7 +102,7 @@ func (bpkg *BuildPackage) recursiveIncludePaths(
 
 	incls := []string{}
 	for _, p := range deps {
-		incls = append(incls, p.publicIncludeDirs(b.targetBuilder.bspPkg)...)
+		incls = append(incls, p.publicIncludeDirs(b)...)
 	}
 
 	return incls, nil
@@ -237,7 +237,8 @@ func (bpkg *BuildPackage) findSdkIncludes() []string {
 	return sdkPathList
 }
 
-func (bpkg *BuildPackage) publicIncludeDirs(bspPkg *pkg.BspPackage) []string {
+func (bpkg *BuildPackage) publicIncludeDirs(b *Builder) []string {
+	bspPkg := b.targetBuilder.bspPkg
 	pkgBase := filepath.Base(bpkg.rpkg.Lpkg.Name())
 	bp := bpkg.rpkg.Lpkg.BasePath()
 
@@ -251,6 +252,16 @@ func (bpkg *BuildPackage) publicIncludeDirs(bspPkg *pkg.BspPackage) []string {
 
 		sdkIncls := bpkg.findSdkIncludes()
 		incls = append(incls, sdkIncls...)
+
+		settings := b.cfg.AllSettingsForLpkg(bpkg.rpkg.Lpkg)
+
+		inclDirs, err := bpkg.rpkg.Lpkg.PkgY.GetValStringSlice(
+			"pkg.include_dirs", settings)
+		util.OneTimeWarningError(err)
+
+		for _, dir := range inclDirs {
+			incls = append(incls, bp + "/" + dir)
+		}
 	}
 
 	return incls