Skip to content

Commit c8ff5b2

Browse files
committed
newt: Append include dirs of non-sdk packages
Now non-sdk packages can also use pkg.include_dirs field
1 parent 16449ee commit c8ff5b2

File tree

1 file changed

+19
-19
lines changed

1 file changed

+19
-19
lines changed

newt/builder/buildpackage.go

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -293,31 +293,31 @@ func (bpkg *BuildPackage) publicIncludeDirs(b *Builder) []string {
293293
addIncludeDir(&incls, bp+"/include/"+pkgBase+"/arch/"+bspPkg.Arch)
294294
}
295295

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

299-
sdkIncls := bpkg.findSdkIncludes()
300-
incls = append(incls, sdkIncls...)
298+
inclDirs, err := bpkg.rpkg.Lpkg.PkgY.GetValStringSlice(
299+
"pkg.include_dirs", settings)
300+
util.OneTimeWarningError(err)
301301

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

304-
inclDirs, err := bpkg.rpkg.Lpkg.PkgY.GetValStringSlice(
305-
"pkg.include_dirs", settings)
306-
util.OneTimeWarningError(err)
305+
if err != nil {
306+
util.OneTimeWarningError(err)
307+
}
307308

308-
for _, dir := range inclDirs {
309-
repo, path, err := newtutil.ParsePackageString(dir)
309+
if repo != "" {
310+
incls = append(incls, "repos/"+repo+"/"+path)
311+
} else {
312+
incls = append(incls, bp+"/"+dir)
313+
}
314+
}
310315

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

315-
if repo != "" {
316-
incls = append(incls, "repos/"+repo+"/"+path)
317-
} else {
318-
incls = append(incls, bp+"/"+dir)
319-
}
320-
}
319+
sdkIncls := bpkg.findSdkIncludes()
320+
incls = append(incls, sdkIncls...)
321321
}
322322

323323
return incls

0 commit comments

Comments
 (0)