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)
|
2024-11-13 13:33:51 +00:00
|
|
|
return strings.HasPrefix(fname, "qcbor")
|
2024-11-04 09:16:01 +00:00
|
|
|
},
|
|
|
|
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,
|
|
|
|
)
|
|
|
|
|
2024-11-26 06:52:58 +00:00
|
|
|
generate(
|
|
|
|
"qt/svg",
|
|
|
|
[]string{
|
|
|
|
"/usr/include/x86_64-linux-gnu/qt5/QtSvg",
|
|
|
|
},
|
|
|
|
AllowAllHeaders,
|
|
|
|
clangBin,
|
|
|
|
pkgConfigCflags("Qt5Svg"),
|
|
|
|
outDir,
|
|
|
|
ClangMatchSameHeaderDefinitionOnly,
|
|
|
|
)
|
|
|
|
|
2024-11-04 09:51:52 +00:00
|
|
|
generate(
|
|
|
|
"qt/network",
|
|
|
|
[]string{
|
|
|
|
"/usr/include/x86_64-linux-gnu/qt5/QtNetwork",
|
|
|
|
},
|
|
|
|
AllowAllHeaders,
|
|
|
|
clangBin,
|
|
|
|
pkgConfigCflags("Qt5Network"),
|
|
|
|
outDir,
|
|
|
|
ClangMatchSameHeaderDefinitionOnly,
|
|
|
|
)
|
|
|
|
|
2024-11-04 10:15:10 +00:00
|
|
|
generate(
|
|
|
|
"qt/multimedia",
|
|
|
|
[]string{
|
|
|
|
// Theoretically, QtMultimediaWidgets and QtMultimedia are different
|
|
|
|
// packages, but QtMultimedia qcamera.h has a dependency on qvideowidget.
|
|
|
|
// Bind them together since our base /qt/ package is Widgets anyway.
|
|
|
|
"/usr/include/x86_64-linux-gnu/qt5/QtMultimedia",
|
|
|
|
"/usr/include/x86_64-linux-gnu/qt5/QtMultimediaWidgets",
|
|
|
|
},
|
|
|
|
AllowAllHeaders,
|
|
|
|
clangBin,
|
|
|
|
pkgConfigCflags("Qt5MultimediaWidgets"),
|
|
|
|
outDir,
|
|
|
|
ClangMatchSameHeaderDefinitionOnly,
|
|
|
|
)
|
|
|
|
|
2024-11-26 06:55:10 +00:00
|
|
|
generate(
|
|
|
|
"qt/script",
|
|
|
|
[]string{
|
|
|
|
"/usr/include/x86_64-linux-gnu/qt5/QtScript",
|
|
|
|
},
|
|
|
|
AllowAllHeaders,
|
|
|
|
clangBin,
|
|
|
|
pkgConfigCflags("Qt5Script"),
|
|
|
|
outDir,
|
|
|
|
ClangMatchSameHeaderDefinitionOnly,
|
|
|
|
)
|
|
|
|
|
2024-11-26 09:31:23 +00:00
|
|
|
// Qt 5 QWebkit: depends on Qt5PrintSupport but only at runtime, not at
|
|
|
|
// codegen time
|
|
|
|
generate(
|
|
|
|
"qt/webkit",
|
|
|
|
[]string{
|
|
|
|
"/usr/include/x86_64-linux-gnu/qt5/QtWebKit",
|
|
|
|
"/usr/include/x86_64-linux-gnu/qt5/QtWebKitWidgets",
|
|
|
|
},
|
|
|
|
AllowAllHeaders,
|
|
|
|
clangBin,
|
|
|
|
pkgConfigCflags("Qt5WebKitWidgets"),
|
|
|
|
outDir,
|
|
|
|
ClangMatchSameHeaderDefinitionOnly,
|
|
|
|
)
|
|
|
|
|
2024-11-27 05:16:40 +00:00
|
|
|
// Qt 5 QWebChannel
|
|
|
|
generate(
|
|
|
|
"qt/webchannel",
|
|
|
|
[]string{
|
|
|
|
"/usr/include/x86_64-linux-gnu/qt5/QtWebChannel",
|
|
|
|
},
|
|
|
|
AllowAllHeaders,
|
|
|
|
clangBin,
|
|
|
|
pkgConfigCflags("Qt5WebChannel"),
|
|
|
|
outDir,
|
|
|
|
ClangMatchSameHeaderDefinitionOnly,
|
|
|
|
)
|
|
|
|
|
|
|
|
// Qt 5 QWebEngine
|
|
|
|
generate(
|
|
|
|
"qt/webengine",
|
|
|
|
[]string{
|
|
|
|
"/usr/include/x86_64-linux-gnu/qt5/QtWebEngine",
|
|
|
|
"/usr/include/x86_64-linux-gnu/qt5/QtWebEngineCore",
|
|
|
|
"/usr/include/x86_64-linux-gnu/qt5/QtWebEngineWidgets",
|
|
|
|
},
|
|
|
|
|
|
|
|
func(fullpath string) bool {
|
|
|
|
baseName := filepath.Base(fullpath)
|
|
|
|
if baseName == "qquickwebengineprofile.h" || baseName == "qquickwebenginescript.h" {
|
|
|
|
return false
|
|
|
|
}
|
|
|
|
return true
|
|
|
|
},
|
|
|
|
clangBin,
|
|
|
|
pkgConfigCflags("Qt5WebEngineWidgets"),
|
|
|
|
outDir,
|
|
|
|
ClangMatchSameHeaderDefinitionOnly,
|
|
|
|
)
|
|
|
|
|
2024-10-20 06:09:16 +00:00
|
|
|
// 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{
|
2024-11-17 16:22:24 +00:00
|
|
|
"/usr/include/x86_64-linux-gnu/qt6/QtCore",
|
2024-11-04 09:16:01 +00:00
|
|
|
},
|
|
|
|
func(fullpath string) bool {
|
|
|
|
// Only include the same json, xml, cbor files excluded above
|
|
|
|
fname := filepath.Base(fullpath)
|
2024-11-13 13:33:51 +00:00
|
|
|
return strings.HasPrefix(fname, "qcbor")
|
2024-11-04 09:16:01 +00:00
|
|
|
},
|
|
|
|
clangBin,
|
2024-11-17 16:22:24 +00:00
|
|
|
"--std=c++20 "+pkgConfigCflags("Qt6Core"),
|
2024-11-04 09:16:01 +00:00
|
|
|
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,
|
|
|
|
)
|
2024-11-04 09:51:52 +00:00
|
|
|
|
2024-11-26 06:52:58 +00:00
|
|
|
// Qt 6 SVG
|
|
|
|
generate(
|
|
|
|
"qt6/svg",
|
|
|
|
[]string{
|
|
|
|
"/usr/include/x86_64-linux-gnu/qt6/QtSvg",
|
|
|
|
"/usr/include/x86_64-linux-gnu/qt6/QtSvgWidgets",
|
|
|
|
},
|
|
|
|
AllowAllHeaders,
|
|
|
|
clangBin,
|
|
|
|
"--std=c++17 "+pkgConfigCflags("Qt6SvgWidgets"),
|
|
|
|
outDir,
|
|
|
|
ClangMatchSameHeaderDefinitionOnly,
|
|
|
|
)
|
|
|
|
|
2024-11-04 09:51:52 +00:00
|
|
|
// Qt 6 QtNetwork
|
|
|
|
generate(
|
|
|
|
"qt6/network",
|
|
|
|
[]string{
|
|
|
|
"/usr/include/x86_64-linux-gnu/qt6/QtNetwork",
|
|
|
|
},
|
|
|
|
func(fullpath string) bool {
|
|
|
|
fname := filepath.Base(fullpath)
|
2024-11-13 13:33:51 +00:00
|
|
|
return fname != "qtnetwork-config.h"
|
2024-11-04 09:51:52 +00:00
|
|
|
},
|
|
|
|
clangBin,
|
|
|
|
"--std=c++17 "+pkgConfigCflags("Qt6Network"),
|
|
|
|
outDir,
|
|
|
|
ClangMatchSameHeaderDefinitionOnly,
|
|
|
|
)
|
2024-11-04 10:15:10 +00:00
|
|
|
|
|
|
|
// Qt 6 QtMultimedia
|
|
|
|
generate(
|
|
|
|
"qt6/multimedia",
|
|
|
|
[]string{
|
|
|
|
"/usr/include/x86_64-linux-gnu/qt6/QtMultimedia",
|
|
|
|
"/usr/include/x86_64-linux-gnu/qt6/QtMultimediaWidgets",
|
|
|
|
},
|
|
|
|
AllowAllHeaders,
|
|
|
|
clangBin,
|
|
|
|
"--std=c++17 "+pkgConfigCflags("Qt6MultimediaWidgets"),
|
|
|
|
outDir,
|
|
|
|
ClangMatchSameHeaderDefinitionOnly,
|
|
|
|
)
|
|
|
|
|
|
|
|
// Qt 6 Spatial Audio (on Debian this is a dependency of Qt6Multimedia)
|
|
|
|
generate(
|
|
|
|
"qt6/spatialaudio",
|
|
|
|
[]string{
|
|
|
|
"/usr/include/x86_64-linux-gnu/qt6/QtSpatialAudio",
|
|
|
|
},
|
|
|
|
AllowAllHeaders,
|
|
|
|
clangBin,
|
|
|
|
"--std=c++17 "+pkgConfigCflags("Qt6SpatialAudio"),
|
|
|
|
outDir,
|
|
|
|
ClangMatchSameHeaderDefinitionOnly,
|
|
|
|
)
|
|
|
|
|
2024-11-27 05:16:40 +00:00
|
|
|
// Qt 6 QWebChannel
|
|
|
|
generate(
|
|
|
|
"qt6/webchannel",
|
|
|
|
[]string{
|
|
|
|
"/usr/include/x86_64-linux-gnu/qt6/QtWebChannel",
|
|
|
|
},
|
|
|
|
AllowAllHeaders,
|
|
|
|
clangBin,
|
|
|
|
"--std=c++17 "+pkgConfigCflags("Qt6WebChannel"),
|
|
|
|
outDir,
|
|
|
|
ClangMatchSameHeaderDefinitionOnly,
|
|
|
|
)
|
|
|
|
|
|
|
|
// Qt 6 QWebEngine
|
|
|
|
generate(
|
|
|
|
"qt6/webengine",
|
|
|
|
[]string{
|
|
|
|
"/usr/include/x86_64-linux-gnu/qt6/QtWebEngineCore",
|
|
|
|
"/usr/include/x86_64-linux-gnu/qt6/QtWebEngineWidgets",
|
|
|
|
},
|
|
|
|
func(fullpath string) bool {
|
|
|
|
baseName := filepath.Base(fullpath)
|
|
|
|
if baseName == "qtwebenginewidgets-config.h" {
|
|
|
|
return false
|
|
|
|
}
|
|
|
|
return true
|
|
|
|
},
|
|
|
|
clangBin,
|
|
|
|
"--std=c++17 "+pkgConfigCflags("Qt6WebEngineWidgets"),
|
|
|
|
outDir,
|
|
|
|
ClangMatchSameHeaderDefinitionOnly,
|
|
|
|
)
|
|
|
|
|
|
|
|
// Qt 6 QScintilla
|
2024-11-06 05:29:56 +00:00
|
|
|
// Depends on QtCore/Gui/Widgets, QPrintSupport
|
|
|
|
generate(
|
|
|
|
"qt-restricted-extras/qscintilla6",
|
|
|
|
[]string{
|
|
|
|
"/usr/include/x86_64-linux-gnu/qt6/Qsci",
|
|
|
|
},
|
|
|
|
AllowAllHeaders,
|
|
|
|
clangBin,
|
|
|
|
"--std=c++17 "+pkgConfigCflags("Qt6PrintSupport"),
|
|
|
|
outDir,
|
|
|
|
ClangMatchSameHeaderDefinitionOnly,
|
|
|
|
)
|
2024-10-20 06:09:16 +00:00
|
|
|
}
|