Skip to content

Commit

Permalink
Merge pull request #35 from yiguous/main
Browse files Browse the repository at this point in the history
improve apple go build
  • Loading branch information
yiguous authored Jul 31, 2024
2 parents f5a830b + c5c3d14 commit 7f89764
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions build/app/apple_go.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,38 +35,39 @@ def __init__(self, build_dir: str):
"arm64",
"arm64",
"iphoneos",
"-mios-version-min=15.0",
"15.0",
),
AppleTarget(
"ios",
"amd64",
"x86_64",
"iphonesimulator",
"-miphonesimulator-version-min=15.0",
"15.0",
),
AppleTarget(
"ios",
"arm64",
"arm64",
"iphonesimulator",
"-miphonesimulator-version-min=15.0",
"15.0",
),
]

# keep same with flutter
self.macos_targets = [
AppleTarget(
"darwin",
"amd64",
"x86_64",
"macosx",
"-mmacosx-version-min=10.14",
"10.14",
),
AppleTarget(
"darwin",
"arm64",
"arm64",
"macosx",
"-mmacosx-version-min=10.14",
"10.14",
),
]

Expand All @@ -76,21 +77,21 @@ def __init__(self, build_dir: str):
"arm64",
"arm64",
"appletvos",
"-mappletvos-version-min=17.0",
"17.0",
),
AppleTarget(
"darwin",
"amd64",
"x86_64",
"appletvsimulator",
"-mappletvsimulator-version-min=17.0",
"17.0",
),
AppleTarget(
"darwin",
"arm64",
"arm64",
"appletvsimulator",
"-mappletvsimulator-version-min=17.0",
"17.0",
),
]

Expand Down Expand Up @@ -142,7 +143,8 @@ def run_build_cmd(
create_dir_if_not_exists(output_dir)
output_file = os.path.join(output_dir, self.lib_file)
sdk_path = self.get_sdk_dir_path(sdk)
flags = f"-isysroot {sdk_path} {min_version} -arch {apple_arch}"
min_version_flag = f"-m{sdk}-version-min={min_version}"
flags = f"-isysroot {sdk_path} {min_version_flag} -arch {apple_arch}"
run_env = os.environ.copy()
run_env["GOOS"] = platform
run_env["GOARCH"] = go_arch
Expand Down

0 comments on commit 7f89764

Please sign in to comment.