Skip to content

Commit b9207f2

Browse files
committed
unix: consolidate assignment of env["TARGET_TRIPLE"]
More copy paste badness.
1 parent 0e60154 commit b9207f2

File tree

1 file changed

+1
-8
lines changed

1 file changed

+1
-8
lines changed

cpython-unix/build.py

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -120,52 +120,44 @@ def add_target_env(env, build_platform, target_triple, build_env):
120120
raise Exception("unhandled macOS machine value: %s" % machine)
121121

122122
if target_triple == "aarch64-apple-darwin":
123-
env["TARGET_TRIPLE"] = "aarch64-apple-darwin"
124123
sdk_platform = "macosx"
125124
min_version_flags = [
126125
"-mmacosx-version-min=%s" % MACOSX_DEPLOYMENT_TARGET_ARM
127126
]
128127
env["APPLE_MIN_DEPLOYMENT_TARGET"] = MACOSX_DEPLOYMENT_TARGET_ARM
129128
elif target_triple == "aarch64-apple-ios":
130-
env["TARGET_TRIPLE"] = "aarch64-apple-ios"
131129
# TODO arm64e not supported by open source Clang.
132130
# TODO add arm7 / arm7s?
133131
sdk_platform = "iphoneos"
134132
min_version_flags = ["-mios-version-min=%s" % IPHONEOS_DEPLOYMENT_TARGET]
135133
env["APPLE_MIN_DEPLOYMENT_TARGET"] = IPHONEOS_DEPLOYMENT_TARGET
136134
elif target_triple == "arm64-apple-tvos":
137-
env["TARGET_TRIPLE"] = "arm64-apple-tvos"
138135
sdk_platform = "appletvos"
139136
min_version_flags = ["-mappletvos-version-min=%s" % TVOS_DEPLOYMENT_TARGET]
140137
env["APPLE_MIN_DEPLOYMENT_TARGET"] = TVOS_DEPLOYMENT_TARGET
141138
elif target_triple == "thumbv7k-apple-watchos":
142-
env["TARGET_TRIPLE"] = "thumbv7k-apple-watchos"
143139
sdk_platform = "watchos"
144140
min_version_flags = ["-mwatchos-version-min=%s" % WATCHOS_DEPLOYMENT_TARGET]
145141
env["APPLE_MIN_DEPLOYMENT_TARGET"] = WATCHOS_DEPLOYMENT_TARGET
146142
elif target_triple == "x86_64-apple-darwin":
147-
env["TARGET_TRIPLE"] = "x86_64-apple-darwin"
148143
sdk_platform = "macosx"
149144
min_version_flags = [
150145
"-mmacosx-version-min=%s" % MACOSX_DEPLOYMENT_TARGET_X86
151146
]
152147
env["APPLE_MIN_DEPLOYMENT_TARGET"] = MACOSX_DEPLOYMENT_TARGET_X86
153148
elif target_triple == "x86_64-apple-ios":
154-
env["TARGET_TRIPLE"] = "x86_64-apple-ios"
155149
sdk_platform = "iphonesimulator"
156150
min_version_flags = [
157151
"-mios-simulator-version-min=%s" % IPHONEOS_DEPLOYMENT_TARGET,
158152
]
159153
env["APPLE_MIN_DEPLOYMENT_TARGET"] = IPHONEOS_DEPLOYMENT_TARGET
160154
elif target_triple == "x86_64-apple-tvos":
161-
env["TARGET_TRIPLE"] = "x86_64-apple-tvos"
162155
sdk_platform = "appletvsimulator"
163156
min_version_flags = [
164157
"-mappletvsimulator-version-min=%s" % TVOS_DEPLOYMENT_TARGET
165158
]
166159
env["APPLE_MIN_DEPLOYMENT_TARGET"] = TVOS_DEPLOYMENT_TARGET
167160
elif target_triple == "x86_64-apple-watchos":
168-
env["TARGET_TRIPLE"] = "x86_64-apple-watchos"
169161
sdk_platform = "watchsimulator"
170162
min_version_flags = [
171163
"-mwatchsimulator-version-min=%s" % WATCHOS_DEPLOYMENT_TARGET
@@ -174,6 +166,7 @@ def add_target_env(env, build_platform, target_triple, build_env):
174166
else:
175167
raise ValueError("unhandled target triple: %s" % target_triple)
176168

169+
env["TARGET_TRIPLE"] = target_triple
177170
env["PATH"] = "/usr/bin:/bin"
178171

179172
extra_target_cflags.extend(

0 commit comments

Comments
 (0)