mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-07 18:35:34 +00:00
cmd/gogio: set minimum iOS simulator version to 13
Metal is available from iOS 8 on devices, yet from version 13 on the simulator. Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
+14
-4
@@ -19,7 +19,12 @@ import (
|
|||||||
"golang.org/x/sync/errgroup"
|
"golang.org/x/sync/errgroup"
|
||||||
)
|
)
|
||||||
|
|
||||||
const minIOSVersion = "9.0"
|
const (
|
||||||
|
minIOSVersion = "9.0"
|
||||||
|
// Metal is available from iOS 8 on devices, yet from version 13 on the
|
||||||
|
// simulator.
|
||||||
|
minSimulatorVersion = "13.0"
|
||||||
|
)
|
||||||
|
|
||||||
func buildIOS(tmpDir, target string, bi *buildInfo) error {
|
func buildIOS(tmpDir, target string, bi *buildInfo) error {
|
||||||
appName := bi.name
|
appName := bi.name
|
||||||
@@ -496,8 +501,11 @@ func supportsGOOS(wantGoos string) (bool, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func iosCompilerFor(target, arch string) (string, []string, error) {
|
func iosCompilerFor(target, arch string) (string, []string, error) {
|
||||||
var platformSDK string
|
var (
|
||||||
var platformOS string
|
platformSDK string
|
||||||
|
platformOS string
|
||||||
|
minVer = minIOSVersion
|
||||||
|
)
|
||||||
switch target {
|
switch target {
|
||||||
case "ios":
|
case "ios":
|
||||||
platformOS = "ios"
|
platformOS = "ios"
|
||||||
@@ -505,6 +513,7 @@ func iosCompilerFor(target, arch string) (string, []string, error) {
|
|||||||
case "tvos":
|
case "tvos":
|
||||||
platformOS = "tvos"
|
platformOS = "tvos"
|
||||||
platformSDK = "appletv"
|
platformSDK = "appletv"
|
||||||
|
|
||||||
}
|
}
|
||||||
switch arch {
|
switch arch {
|
||||||
case "arm", "arm64":
|
case "arm", "arm64":
|
||||||
@@ -512,6 +521,7 @@ func iosCompilerFor(target, arch string) (string, []string, error) {
|
|||||||
case "386", "amd64":
|
case "386", "amd64":
|
||||||
platformOS += "-simulator"
|
platformOS += "-simulator"
|
||||||
platformSDK += "simulator"
|
platformSDK += "simulator"
|
||||||
|
minVer = minSimulatorVersion
|
||||||
default:
|
default:
|
||||||
return "", nil, fmt.Errorf("unsupported -arch: %s", arch)
|
return "", nil, fmt.Errorf("unsupported -arch: %s", arch)
|
||||||
}
|
}
|
||||||
@@ -527,7 +537,7 @@ func iosCompilerFor(target, arch string) (string, []string, error) {
|
|||||||
"-fembed-bitcode",
|
"-fembed-bitcode",
|
||||||
"-arch", allArchs[arch].iosArch,
|
"-arch", allArchs[arch].iosArch,
|
||||||
"-isysroot", sdkPath,
|
"-isysroot", sdkPath,
|
||||||
"-m" + platformOS + "-version-min=" + minIOSVersion,
|
"-m" + platformOS + "-version-min=" + minVer,
|
||||||
}
|
}
|
||||||
return clang, cflags, nil
|
return clang, cflags, nil
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user