You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by ja...@apache.org on 2024/04/16 15:14:37 UTC

(mynewt-newt) branch master updated: builder: Add private includes only to specific packages

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

janc 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 0ce1291b builder: Add private includes only to specific packages
0ce1291b is described below

commit 0ce1291b2aee1f3b05f1b742b5384750920ec6e0
Author: Michal Gorecki <mi...@codecoup.pl>
AuthorDate: Tue Apr 16 12:17:55 2024 +0200

    builder: Add private includes only to specific packages
    
    Instead of adding private includes paths to every package
    we should add them to the specific packages
---
 newt/builder/build.go        | 4 ++++
 newt/builder/buildpackage.go | 2 +-
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/newt/builder/build.go b/newt/builder/build.go
index b611df3a..287ef0b2 100644
--- a/newt/builder/build.go
+++ b/newt/builder/build.go
@@ -322,6 +322,10 @@ func (b *Builder) collectCompileEntriesBpkg(bpkg *BuildPackage) (
 		return nil, err
 	}
 
+	var privateIncCi toolchain.CompilerInfo
+	privateIncCi.Includes = bpkg.privateIncludeDirs(b)
+	c.AddInfo(&privateIncCi)
+
 	srcDirs := []string{}
 
 	if len(bpkg.SourceDirectories) > 0 {
diff --git a/newt/builder/buildpackage.go b/newt/builder/buildpackage.go
index 7bcd835d..9513bcef 100644
--- a/newt/builder/buildpackage.go
+++ b/newt/builder/buildpackage.go
@@ -243,7 +243,7 @@ func (bpkg *BuildPackage) CompilerInfo(
 		return nil, err
 	}
 
-	ci.Includes = append(bpkg.privateIncludeDirs(b), includePaths...)
+	ci.Includes = append(ci.Includes, includePaths...)
 	bpkg.ci = ci
 
 	return bpkg.ci, nil