Merge pull request #1043 from angiglesias/master

Fixed mismatching -D__ANDROID_API__ cgo flag thorough building steps
This commit is contained in:
therecipe 2020-01-25 20:45:13 +01:00 committed by GitHub
commit 781163f259
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 6 deletions

View file

@ -573,10 +573,7 @@ func BuildEnv(target, name, depPath string) (map[string]string, []string, []stri
var out string
var env map[string]string
androidAPI := "21"
if utils.QT_FELGO() {
androidAPI = "16"
}
androidAPI := utils.ANDROID_NDK_PLATFORM()
switch target {
case "android":
@ -604,7 +601,7 @@ func BuildEnv(target, name, depPath string) (map[string]string, []string, []stri
"CGO_LDFLAGS": fmt.Sprintf("-Wno-unused-command-line-argument -D__ANDROID_API__=%v -target armv7-none-linux-androideabi -gcc-toolchain %v --sysroot=%v",
androidAPI,
filepath.Join(utils.ANDROID_NDK_DIR(), "toolchains", "arm-linux-androideabi-4.9", "prebuilt", runtime.GOOS+"-x86_64"),
filepath.Join(utils.ANDROID_NDK_DIR(), "platforms", "android-21", "arch-arm")),
filepath.Join(utils.ANDROID_NDK_DIR(), "platforms", androidAPI, "arch-arm")),
}
if runtime.GOOS == "windows" {
env["TMP"] = os.Getenv("TMP")

View file

@ -130,6 +130,7 @@ func ANDROID_NDK_PLATFORM() string {
return value
}
// default value as set in cmd.go BuildEnv function
// default value as recommended in https://wiki.qt.io/Qt_for_Android_known_issues
// to workaround problems with arm64 android builds
return "android-21"
}