minor go interop related changes

This commit is contained in:
therecipe 2020-08-14 02:34:04 +02:00
parent 250d4bee0a
commit 77936453f6
2 changed files with 6 additions and 3 deletions

View file

@ -624,6 +624,9 @@ func createCgo(module, path, target string, mode int, ipkg, tags string) string
if !utils.QT_MSVC() {
fmt.Fprint(bb, "#cgo LDFLAGS: -Wl,--allow-multiple-definition\n")
}
if utils.QT_MXE() && utils.QT_MXE_STATIC() && mode == NONE { //TODO: MSYS2 as well ?
fmt.Fprint(bb, "#cgo CXXFLAGS: -Wa,-mbig-obj\n")
}
case "ios":
fmt.Fprintf(bb, "#cgo CXXFLAGS: -isysroot %v/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/%v -miphoneos-version-min=11.0\n", utils.XCODE_DIR(), utils.IPHONEOS_SDK_DIR())
fmt.Fprintf(bb, "#cgo LDFLAGS: -Wl,-syslibroot,%v/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/%v -miphoneos-version-min=11.0\n", utils.XCODE_DIR(), utils.IPHONEOS_SDK_DIR())

View file

@ -27,8 +27,7 @@ func Generate(target string, docker, vagrant bool) {
mode := "full"
switch {
case target == "js", target == "wasm",
(utils.QT_STATIC() || utils.QT_MXE_STATIC() || utils.QT_MSYS2_STATIC()) && utils.QT_DOCKER():
case target == "js", target == "wasm":
case target != runtime.GOOS:
mode = "cgo"
@ -54,7 +53,8 @@ func Generate(target string, docker, vagrant bool) {
}
utils.Log.Infof("generating %v qt/%v%v", mode, strings.ToLower(module), license)
if target == runtime.GOOS || utils.QT_FAT() || (mode == "full" && (target == "js" || target == "wasm")) { //TODO: REVIEW
if target == runtime.GOOS || utils.QT_FAT() || (mode == "full" && (target == "js" || target == "wasm")) ||
(utils.QT_STATIC() || utils.QT_MXE_STATIC()) && utils.QT_DOCKER() { //TODO: REVIEW
templater.GenModule(module, target, templater.NONE)
} else {
templater.CgoTemplate(module, "", target, templater.MINIMAL, "", "") //TODO: collect errors