Skip to content

Commit

Permalink
fix moc inf loop issue + fixes for Qt 5.13 + fix asset dir deployment…
Browse files Browse the repository at this point in the history
… for msys2 and mxe builds
  • Loading branch information
therecipe committed Mar 26, 2019
1 parent c5b2d3f commit e1b1bf0
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 22 deletions.
8 changes: 0 additions & 8 deletions dbus/dbus.go
Original file line number Diff line number Diff line change
Expand Up @@ -3928,14 +3928,6 @@ func (ptr *QDBusPendingReply) DestroyQDBusPendingReply() {
}
}

//go:generate stringer -type=QDBusPendingReply__anonymous
//QDBusPendingReply::anonymous
type QDBusPendingReply__anonymous int64

const (
QDBusPendingReply__Count QDBusPendingReply__anonymous = QDBusPendingReply__anonymous(0)
)

type QDBusPendingReplyTypes struct {
ptr unsafe.Pointer
}
Expand Down
6 changes: 4 additions & 2 deletions internal/binding/parser/class.go
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,9 @@ func (c *Class) HasFunctionWithName(n string) bool {

func (c *Class) HasFunctionWithNameAndOverloadNumber(n string, num string) bool {
for _, f := range c.Functions {
if f.Name == n && f.OverloadNumber == num {
if ((strings.ToLower(f.Name) == strings.ToLower(n) && c.Module != MOC) ||
(f.Name == n && c.Module == MOC)) &&
f.OverloadNumber == num {
return true
}
}
Expand Down Expand Up @@ -235,7 +237,7 @@ func (c *Class) IsSupported() bool {

switch c.Name {
case "QCborStreamReader", "QCborStreamWriter", "QCborValue", "QScopeGuard", "QTest",
"QImageReaderWriterHelpers", "QPasswordDigestor", "QDtls", "QDtlsClientVerifier":
"QImageReaderWriterHelpers", "QPasswordDigestor", "QDtls", "QDtlsClientVerifier", "QGeoJson":
c.Access = "unsupported_isBlockedClass"
return false
}
Expand Down
4 changes: 2 additions & 2 deletions internal/binding/parser/class_remove.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ func (c *Class) removeFunctions() {
case (f.Status == "obsolete" || f.Status == "compat") ||
!(f.Access == "public" || f.Access == "protected") ||
strings.ContainsAny(f.Name, "&<>=/!()[]{}^|*+-") ||
strings.Contains(f.Name, "Operator"):
strings.Contains(f.Name, "Operator") || strings.Contains(f.Name, "qHash"):
{
c.Functions = append(c.Functions[:i], c.Functions[i+1:]...)
}
Expand Down Expand Up @@ -66,7 +66,7 @@ func (c *Class) removeEnums() {
func (c *Class) removeEnums_Version() {
for i := len(c.Enums) - 1; i >= 0; i-- {
switch c.Enums[i].ClassName() {
case "QCss", "QScript", "Http2":
case "QCss", "QScript", "Http2", "QDBusPendingReply":
{
c.Enums = append(c.Enums[:i], c.Enums[i+1:]...)
continue
Expand Down
8 changes: 8 additions & 0 deletions internal/binding/parser/function.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ type Function struct {
Parameters []*Parameter `xml:"parameter"`
Brief string `xml:"brief,attr"`
Since string `xml:"since,attr"`
Related string `xml:"related,attr"`
SignalMode string
TemplateModeJNI string
Default bool
Expand Down Expand Up @@ -288,8 +289,15 @@ func (f *Function) IsSupported() bool {
}
}

if f.Related == "true" {
f.Access = "unsupported_isBlockedFunction"
return false
}

switch {
case
f.Fullname == "QOcspResponse::certificateStatus", f.Fullname == "QOcspResponse::revocationReason",

f.ClassName() == "operator QCborError",

(f.ClassName() == "QAccessibleObject" || f.ClassName() == "QAccessibleInterface" || f.ClassName() == "QAccessibleWidget" || //QAccessible::State -> quint64
Expand Down
2 changes: 2 additions & 0 deletions internal/binding/templater/template_cgo_qmake.go
Original file line number Diff line number Diff line change
Expand Up @@ -565,6 +565,8 @@ func createCgo(module, path, target string, mode int, ipkg, tags string) string
tmp = strings.Replace(tmp, "-lQt5"+lib, "-framework Qt"+lib, -1)
}
tmp = strings.Replace(tmp, "-Wl,-rpath,@executable_path/Frameworks", "", -1)
tmp = strings.Replace(tmp, "-Wl,-rpath,@executable_path/../Frameworks", "", -1)
tmp = strings.Replace(tmp, "-weak_framework XCTest", "", -1)
case "windows":
if utils.QT_MSYS2() {
tmp = strings.Replace(tmp, ",--relax,--gc-sections", "", -1)
Expand Down
21 changes: 11 additions & 10 deletions internal/cmd/deploy/bundle.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ func bundle(mode, target, path, name, depPath string, tagsCustom string, fast bo
copy := func(src, dst string) {
copy := "cp"

if runtime.GOOS == "windows" {
if runtime.GOOS == "windows" && utils.MSYSTEM() == "" {
copy = "xcopy"

//TODO: -->
Expand All @@ -37,14 +37,14 @@ func bundle(mode, target, path, name, depPath string, tagsCustom string, fast bo

var args []string
if _, err := ioutil.ReadDir(src); err == nil {
if runtime.GOOS != "windows" {
if runtime.GOOS != "windows" || utils.MSYSTEM() != "" {
args = append(args, "-R")
}
}

var suffix string
if _, err := ioutil.ReadDir(dst); err != nil {
if runtime.GOOS == "windows" {
if runtime.GOOS == "windows" && utils.MSYSTEM() == "" {
suffix = "*"
}
}
Expand Down Expand Up @@ -253,6 +253,14 @@ func bundle(mode, target, path, name, depPath string, tagsCustom string, fast bo

case "windows":

//copy default assets
//TODO: windres icon

//copy custom assets
assets := filepath.Join(path, target)
utils.MkdirAll(assets)
copy(assets+string(filepath.Separator)+".", depPath)

//TODO: -->
switch {
case runtime.GOOS != target:
Expand Down Expand Up @@ -371,13 +379,6 @@ func bundle(mode, target, path, name, depPath string, tagsCustom string, fast bo
filepath.Walk(depPath, walkFn)

default:
//copy default assets
//TODO: windres icon

//copy custom assets
assets := filepath.Join(path, target)
utils.MkdirAll(assets)
copy(assets, depPath)

if utils.QT_WEBKIT() {
libraryPath := filepath.Dir(utils.ToolPath("qmake", target))
Expand Down

0 comments on commit e1b1bf0

Please sign in to comment.