mirror of
https://github.com/mappu/miqt.git
synced 2025-01-03 06:08:38 +00:00
genbindings: avoid generating empty files
This commit is contained in:
parent
926cfc7c84
commit
043db615b1
@ -176,3 +176,8 @@ type CppParsedHeader struct {
|
|||||||
Typedefs []CppTypedef
|
Typedefs []CppTypedef
|
||||||
Classes []CppClass
|
Classes []CppClass
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (c CppParsedHeader) Empty() bool {
|
||||||
|
return len(c.Typedefs) == 0 &&
|
||||||
|
len(c.Classes) == 0
|
||||||
|
}
|
||||||
|
@ -192,6 +192,12 @@ func main() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Breakout if there is nothing bindable
|
||||||
|
if parsed.Empty() {
|
||||||
|
log.Printf("Nothing in this header was bindable.")
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
// Emit 3 code files from the intermediate format
|
// Emit 3 code files from the intermediate format
|
||||||
outputName := filepath.Join(*outDir, "gen_"+strings.TrimSuffix(filepath.Base(inputHeader), `.h`))
|
outputName := filepath.Join(*outDir, "gen_"+strings.TrimSuffix(filepath.Base(inputHeader), `.h`))
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user