Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
newt: Append include dirs of non-sdk packages
Now non-sdk packages can also use pkg.include_dirs field
  • Loading branch information
m-gorecki committed Jan 28, 2025
commit c8ff5b217cfe90e11295e0fd987d04188807e98a
38 changes: 19 additions & 19 deletions newt/builder/buildpackage.go
Original file line number Diff line number Diff line change
Expand Up @@ -293,31 +293,31 @@ func (bpkg *BuildPackage) publicIncludeDirs(b *Builder) []string {
addIncludeDir(&incls, bp+"/include/"+pkgBase+"/arch/"+bspPkg.Arch)
}

if bpkg.rpkg.Lpkg.Type() == pkg.PACKAGE_TYPE_SDK {
incls = append(incls, bspPkg.BasePath()+"/include/bsp/")
settings := b.cfg.AllSettingsForLpkg(bpkg.rpkg.Lpkg)

sdkIncls := bpkg.findSdkIncludes()
incls = append(incls, sdkIncls...)
inclDirs, err := bpkg.rpkg.Lpkg.PkgY.GetValStringSlice(
"pkg.include_dirs", settings)
util.OneTimeWarningError(err)

settings := b.cfg.AllSettingsForLpkg(bpkg.rpkg.Lpkg)
for _, dir := range inclDirs {
repo, path, err := newtutil.ParsePackageString(dir)

inclDirs, err := bpkg.rpkg.Lpkg.PkgY.GetValStringSlice(
"pkg.include_dirs", settings)
util.OneTimeWarningError(err)
if err != nil {
util.OneTimeWarningError(err)
}

for _, dir := range inclDirs {
repo, path, err := newtutil.ParsePackageString(dir)
if repo != "" {
incls = append(incls, "repos/"+repo+"/"+path)
} else {
incls = append(incls, bp+"/"+dir)
}
}

if err != nil {
util.OneTimeWarningError(err)
}
if bpkg.rpkg.Lpkg.Type() == pkg.PACKAGE_TYPE_SDK {
incls = append(incls, bspPkg.BasePath()+"/include/bsp/")

if repo != "" {
incls = append(incls, "repos/"+repo+"/"+path)
} else {
incls = append(incls, bp+"/"+dir)
}
}
sdkIncls := bpkg.findSdkIncludes()
incls = append(incls, sdkIncls...)
}

return incls
Expand Down
Loading