@@ -19,6 +19,7 @@ type ImportCCProps struct {
1919 Target toolchain.TgtType
2020 Linkopts []string
2121 Defines []string
22+ Includes []string
2223}
2324
2425type ModuleImportCC struct {
@@ -34,6 +35,7 @@ var _ splittable = (*ModuleImportCC)(nil)
3435type importCCInterface interface {
3536 splittable
3637 file.Provider
38+ flag.Provider
3739}
3840
3941func (m * ModuleImportCC ) shortName () string {
@@ -43,6 +45,7 @@ func (m *ModuleImportCC) shortName() string {
4345func (m * ModuleImportCC ) processPaths (ctx blueprint.BaseModuleContext ) {
4446 prefix := projectModuleDir (ctx )
4547 m .Properties .Headers = utils .PrefixDirs (m .Properties .Headers , prefix )
48+ m .Properties .Includes = utils .PrefixDirs (m .Properties .Includes , prefix )
4649}
4750
4851func (m * ModuleImportCC ) OutFiles () (files file.Paths ) {
@@ -58,7 +61,7 @@ func (m *ModuleImportCC) OutFiles() (files file.Paths) {
5861
5962func (m * ModuleImportCC ) FlagsOut () (flags flag.Flags ) {
6063 headerPath := filepath .Join (backend .Get ().BuildDir (), "gen" , m .shortName ())
61- flags = append (flags , flag .FromIncludePathOwned (headerPath , m , flag .TypeInclude ))
64+ flags = append (flags , flag .FromIncludePathOwned (headerPath , m , flag .TypeInclude | flag . TypeExported ))
6265 lut := flag.FlagParserTable {
6366 {
6467 PropertyName : "Defines" ,
@@ -73,6 +76,11 @@ func (m *ModuleImportCC) FlagsOut() (flags flag.Flags) {
7376 }
7477 flags = append (flags , flag .ParseFromProperties (nil , lut , m .Properties )... )
7578
79+ for _ , dir := range m .Properties .Includes {
80+ fp := file .NewPath (dir , m .Name (), file .TypeHeader )
81+ flags = append (flags , flag .FromIncludePath (fp .BuildPath (), flag .TypeInclude | flag .TypeExported ))
82+ }
83+
7684 return
7785}
7886
0 commit comments