2024-10-20 06:09:16 +00:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
|
|
|
"path/filepath"
|
2024-11-04 09:16:01 +00:00
|
|
|
"strings"
|
2024-10-20 06:09:16 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
func ProcessLibraries(clangBin, outDir, extraLibsDir string) {
|
|
|
|
|
2024-11-04 09:16:01 +00:00
|
|
|
AllowAllHeaders := func(string) bool { return true }
|
|
|
|
|
2024-10-20 06:09:16 +00:00
|
|
|
flushKnownTypes()
|
|
|
|
InsertTypedefs(false)
|
|
|
|
|
|
|
|
generate(
|
|
|
|
"qt",
|
|
|
|
[]string{
|
|
|
|
"/usr/include/x86_64-linux-gnu/qt5/QtCore",
|
|
|
|
"/usr/include/x86_64-linux-gnu/qt5/QtGui",
|
|
|
|
"/usr/include/x86_64-linux-gnu/qt5/QtWidgets",
|
|
|
|
},
|
2024-11-04 09:16:01 +00:00
|
|
|
func(fullpath string) bool {
|
|
|
|
// Block cbor and generate it separately
|
|
|
|
fname := filepath.Base(fullpath)
|
|
|
|
if strings.HasPrefix(fname, "qcbor") {
|
|
|
|
return false
|
|
|
|
}
|
|
|
|
|
|
|
|
return Widgets_AllowHeader(fullpath)
|
|
|
|
},
|
2024-10-20 06:09:16 +00:00
|
|
|
clangBin,
|
|
|
|
pkgConfigCflags("Qt5Widgets"),
|
|
|
|
outDir,
|
|
|
|
ClangMatchSameHeaderDefinitionOnly,
|
|
|
|
)
|
|
|
|
|
2024-11-04 09:16:01 +00:00
|
|
|
generate(
|
|
|
|
"qt/cbor",
|
|
|
|
[]string{
|
|
|
|
"/usr/include/x86_64-linux-gnu/qt5/QtCore",
|
|
|
|
},
|
|
|
|
func(fullpath string) bool {
|
|
|
|
// Only include the same json, xml, cbor files excluded above
|
|
|
|
fname := filepath.Base(fullpath)
|
|
|
|
if strings.HasPrefix(fname, "qcbor") {
|
|
|
|
return true
|
|
|
|
}
|
|
|
|
|
|
|
|
return false
|
|
|
|
},
|
|
|
|
clangBin,
|
|
|
|
pkgConfigCflags("Qt5Core"),
|
|
|
|
outDir,
|
|
|
|
ClangMatchSameHeaderDefinitionOnly,
|
|
|
|
)
|
|
|
|
|
2024-10-20 06:09:16 +00:00
|
|
|
generate(
|
2024-11-04 09:13:59 +00:00
|
|
|
"qt/printsupport",
|
2024-10-20 06:09:16 +00:00
|
|
|
[]string{
|
|
|
|
"/usr/include/x86_64-linux-gnu/qt5/QtPrintSupport",
|
|
|
|
},
|
2024-11-04 09:16:01 +00:00
|
|
|
AllowAllHeaders,
|
2024-10-20 06:09:16 +00:00
|
|
|
clangBin,
|
|
|
|
pkgConfigCflags("Qt5PrintSupport"),
|
|
|
|
outDir,
|
|
|
|
ClangMatchSameHeaderDefinitionOnly,
|
|
|
|
)
|
|
|
|
|
|
|
|
// Depends on QtCore/Gui/Widgets, QPrintSupport
|
|
|
|
generate(
|
|
|
|
"qt-restricted-extras/qscintilla",
|
|
|
|
[]string{
|
|
|
|
"/usr/include/x86_64-linux-gnu/qt5/Qsci",
|
|
|
|
},
|
2024-11-04 09:16:01 +00:00
|
|
|
AllowAllHeaders,
|
2024-10-20 06:09:16 +00:00
|
|
|
clangBin,
|
|
|
|
pkgConfigCflags("Qt5PrintSupport"),
|
|
|
|
outDir,
|
|
|
|
ClangMatchSameHeaderDefinitionOnly,
|
|
|
|
)
|
|
|
|
|
|
|
|
// Depends on QtCore/Gui/Widgets
|
|
|
|
generate(
|
|
|
|
"qt-extras/scintillaedit",
|
|
|
|
[]string{
|
|
|
|
filepath.Join(extraLibsDir, "scintilla/qt/ScintillaEdit/ScintillaEdit.h"),
|
|
|
|
},
|
2024-11-04 09:16:01 +00:00
|
|
|
AllowAllHeaders,
|
2024-10-20 06:09:16 +00:00
|
|
|
clangBin,
|
|
|
|
"--std=c++1z "+pkgConfigCflags("ScintillaEdit"),
|
|
|
|
outDir,
|
|
|
|
(&clangMatchUnderPath{filepath.Join(extraLibsDir, "scintilla")}).Match,
|
|
|
|
)
|
|
|
|
|
|
|
|
// FLUSH all known typedefs / ...
|
|
|
|
|
|
|
|
flushKnownTypes()
|
|
|
|
InsertTypedefs(true)
|
|
|
|
|
|
|
|
// Qt 6
|
|
|
|
generate(
|
|
|
|
"qt6",
|
|
|
|
[]string{
|
|
|
|
"/usr/include/x86_64-linux-gnu/qt6/QtCore",
|
|
|
|
"/usr/include/x86_64-linux-gnu/qt6/QtGui",
|
|
|
|
"/usr/include/x86_64-linux-gnu/qt6/QtWidgets",
|
|
|
|
},
|
2024-11-04 09:16:01 +00:00
|
|
|
func(fullpath string) bool {
|
|
|
|
// Block cbor and generate it separately
|
|
|
|
fname := filepath.Base(fullpath)
|
|
|
|
if strings.HasPrefix(fname, "qcbor") {
|
|
|
|
return false
|
|
|
|
}
|
|
|
|
|
|
|
|
return Widgets_AllowHeader(fullpath)
|
|
|
|
},
|
2024-10-20 06:09:16 +00:00
|
|
|
clangBin,
|
|
|
|
"--std=c++17 "+pkgConfigCflags("Qt6Widgets"),
|
|
|
|
outDir,
|
|
|
|
ClangMatchSameHeaderDefinitionOnly,
|
|
|
|
)
|
|
|
|
|
2024-11-04 09:16:01 +00:00
|
|
|
generate(
|
|
|
|
"qt6/cbor",
|
|
|
|
[]string{
|
|
|
|
"/usr/include/x86_64-linux-gnu/qt5/QtCore",
|
|
|
|
},
|
|
|
|
func(fullpath string) bool {
|
|
|
|
// Only include the same json, xml, cbor files excluded above
|
|
|
|
fname := filepath.Base(fullpath)
|
|
|
|
if strings.HasPrefix(fname, "qcbor") {
|
|
|
|
return true
|
|
|
|
}
|
|
|
|
|
|
|
|
return false
|
|
|
|
},
|
|
|
|
clangBin,
|
|
|
|
pkgConfigCflags("Qt6Core"),
|
|
|
|
outDir,
|
|
|
|
ClangMatchSameHeaderDefinitionOnly,
|
|
|
|
)
|
|
|
|
|
2024-10-20 06:09:16 +00:00
|
|
|
// Qt 6 QtPrintSupport
|
|
|
|
generate(
|
2024-11-04 09:13:59 +00:00
|
|
|
"qt6/printsupport",
|
2024-10-20 06:09:16 +00:00
|
|
|
[]string{
|
|
|
|
"/usr/include/x86_64-linux-gnu/qt6/QtPrintSupport",
|
|
|
|
},
|
2024-11-04 09:16:01 +00:00
|
|
|
AllowAllHeaders,
|
2024-10-20 06:09:16 +00:00
|
|
|
clangBin,
|
|
|
|
"--std=c++17 "+pkgConfigCflags("Qt6PrintSupport"),
|
|
|
|
outDir,
|
|
|
|
ClangMatchSameHeaderDefinitionOnly,
|
|
|
|
)
|
|
|
|
}
|