Skip to content

Commit 7f89764

Browse files
authored
Merge pull request #35 from yiguous/main
improve apple go build
2 parents f5a830b + c5c3d14 commit 7f89764

File tree

1 file changed

+11
-9
lines changed

1 file changed

+11
-9
lines changed

build/app/apple_go.py

+11-9
Original file line numberDiff line numberDiff line change
@@ -35,38 +35,39 @@ def __init__(self, build_dir: str):
3535
"arm64",
3636
"arm64",
3737
"iphoneos",
38-
"-mios-version-min=15.0",
38+
"15.0",
3939
),
4040
AppleTarget(
4141
"ios",
4242
"amd64",
4343
"x86_64",
4444
"iphonesimulator",
45-
"-miphonesimulator-version-min=15.0",
45+
"15.0",
4646
),
4747
AppleTarget(
4848
"ios",
4949
"arm64",
5050
"arm64",
5151
"iphonesimulator",
52-
"-miphonesimulator-version-min=15.0",
52+
"15.0",
5353
),
5454
]
5555

56+
# keep same with flutter
5657
self.macos_targets = [
5758
AppleTarget(
5859
"darwin",
5960
"amd64",
6061
"x86_64",
6162
"macosx",
62-
"-mmacosx-version-min=10.14",
63+
"10.14",
6364
),
6465
AppleTarget(
6566
"darwin",
6667
"arm64",
6768
"arm64",
6869
"macosx",
69-
"-mmacosx-version-min=10.14",
70+
"10.14",
7071
),
7172
]
7273

@@ -76,21 +77,21 @@ def __init__(self, build_dir: str):
7677
"arm64",
7778
"arm64",
7879
"appletvos",
79-
"-mappletvos-version-min=17.0",
80+
"17.0",
8081
),
8182
AppleTarget(
8283
"darwin",
8384
"amd64",
8485
"x86_64",
8586
"appletvsimulator",
86-
"-mappletvsimulator-version-min=17.0",
87+
"17.0",
8788
),
8889
AppleTarget(
8990
"darwin",
9091
"arm64",
9192
"arm64",
9293
"appletvsimulator",
93-
"-mappletvsimulator-version-min=17.0",
94+
"17.0",
9495
),
9596
]
9697

@@ -142,7 +143,8 @@ def run_build_cmd(
142143
create_dir_if_not_exists(output_dir)
143144
output_file = os.path.join(output_dir, self.lib_file)
144145
sdk_path = self.get_sdk_dir_path(sdk)
145-
flags = f"-isysroot {sdk_path} {min_version} -arch {apple_arch}"
146+
min_version_flag = f"-m{sdk}-version-min={min_version}"
147+
flags = f"-isysroot {sdk_path} {min_version_flag} -arch {apple_arch}"
146148
run_env = os.environ.copy()
147149
run_env["GOOS"] = platform
148150
run_env["GOARCH"] = go_arch

0 commit comments

Comments
 (0)