Created
October 14, 2017 02:28
-
-
Save Ouroboros/7a55779bafec0bab5c385c4bf16c1f3e to your computer and use it in GitHub Desktop.
Fix https://github.com/therecipe/qt on windows
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/internal/binding/templater/template_cgo_qmake.go b/internal/binding/templater/template_cgo_qmake.go | |
index bcd4f4a..57c32f2 100644 | |
--- a/internal/binding/templater/template_cgo_qmake.go | |
+++ b/internal/binding/templater/template_cgo_qmake.go | |
@@ -397,8 +397,8 @@ func createCgo(module, path, target string, mode int, ipkg, tags string) string | |
tmp = strings.Replace(tmp, "-lQt5"+lib, "-framework Qt"+lib, -1) | |
} | |
case "windows": | |
- if utils.QT_MSYS2() && !utils.QT_MSYS2_STATIC() { | |
tmp = strings.Replace(tmp, ",--relax,--gc-sections", "", -1) | |
+ if utils.QT_MSYS2() && !utils.QT_MSYS2_STATIC() { | |
} | |
if utils.QT_MSYS2() && utils.QT_MSYS2_ARCH() == "amd64" { | |
tmp = strings.Replace(tmp, " -Wa,-mbig-obj ", " ", -1) | |
diff --git a/internal/utils/utils.go b/internal/utils/utils.go | |
index 9ebda09..abeb920 100644 | |
--- a/internal/utils/utils.go | |
+++ b/internal/utils/utils.go | |
@@ -21,11 +21,21 @@ func ExistsDir(name string) bool { | |
} | |
func MkdirAll(dir string) error { | |
- err := os.MkdirAll(dir, 0755) | |
- if err != nil { | |
+ for { | |
+ err := os.MkdirAll(dir, 0755) | |
+ | |
+ if err == nil { | |
+ return nil | |
+ } | |
+ | |
+ if strings.Contains(err.Error(), "Access") { | |
+ continue | |
+ } | |
+ | |
Log.WithError(err).Panicf("failed to create dir %v", dir) | |
+ | |
+ return err | |
} | |
- return err | |
} | |
func RemoveAll(name string) error { |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment