@@ -95,8 +95,8 @@ def add_target_env(env, build_platform, target_triple, build_env):
95
95
env ["PYBUILD_PLATFORM" ] = build_platform
96
96
env ["TOOLS_PATH" ] = build_env .tools_path
97
97
98
- extra_target_cflags = []
99
- extra_target_ldflags = []
98
+ extra_target_cflags = list ( settings . get ( "target_cflags" , []))
99
+ extra_target_ldflags = list ( settings . get ( "target_ldflags" , []))
100
100
extra_host_cflags = []
101
101
extra_host_ldflags = []
102
102
@@ -109,10 +109,6 @@ def add_target_env(env, build_platform, target_triple, build_env):
109
109
else :
110
110
env ["TARGET_TRIPLE" ] = target_triple
111
111
112
- if target_triple == "i686-unknown-linux-gnu" :
113
- extra_target_cflags .append ("-m32" )
114
- extra_target_ldflags .append ("-m32" )
115
-
116
112
if build_platform == "macos" :
117
113
machine = platform .machine ()
118
114
@@ -125,7 +121,6 @@ def add_target_env(env, build_platform, target_triple, build_env):
125
121
126
122
if target_triple == "aarch64-apple-darwin" :
127
123
env ["TARGET_TRIPLE" ] = "aarch64-apple-darwin"
128
- arches = ["arm64" ]
129
124
sdk_platform = "macosx"
130
125
min_version_flags = [
131
126
"-mmacosx-version-min=%s" % MACOSX_DEPLOYMENT_TARGET_ARM
@@ -135,49 +130,42 @@ def add_target_env(env, build_platform, target_triple, build_env):
135
130
env ["TARGET_TRIPLE" ] = "aarch64-apple-ios"
136
131
# TODO arm64e not supported by open source Clang.
137
132
# TODO add arm7 / arm7s?
138
- arches = ["arm64" ]
139
133
sdk_platform = "iphoneos"
140
134
min_version_flags = ["-mios-version-min=%s" % IPHONEOS_DEPLOYMENT_TARGET ]
141
135
env ["APPLE_MIN_DEPLOYMENT_TARGET" ] = IPHONEOS_DEPLOYMENT_TARGET
142
136
elif target_triple == "arm64-apple-tvos" :
143
137
env ["TARGET_TRIPLE" ] = "arm64-apple-tvos"
144
- arches = ["arm64" ]
145
138
sdk_platform = "appletvos"
146
139
min_version_flags = ["-mappletvos-version-min=%s" % TVOS_DEPLOYMENT_TARGET ]
147
140
env ["APPLE_MIN_DEPLOYMENT_TARGET" ] = TVOS_DEPLOYMENT_TARGET
148
141
elif target_triple == "thumbv7k-apple-watchos" :
149
142
env ["TARGET_TRIPLE" ] = "thumbv7k-apple-watchos"
150
- arches = ["armv7k" ]
151
143
sdk_platform = "watchos"
152
144
min_version_flags = ["-mwatchos-version-min=%s" % WATCHOS_DEPLOYMENT_TARGET ]
153
145
env ["APPLE_MIN_DEPLOYMENT_TARGET" ] = WATCHOS_DEPLOYMENT_TARGET
154
146
elif target_triple == "x86_64-apple-darwin" :
155
147
env ["TARGET_TRIPLE" ] = "x86_64-apple-darwin"
156
- arches = ["x86_64" ]
157
148
sdk_platform = "macosx"
158
149
min_version_flags = [
159
150
"-mmacosx-version-min=%s" % MACOSX_DEPLOYMENT_TARGET_X86
160
151
]
161
152
env ["APPLE_MIN_DEPLOYMENT_TARGET" ] = MACOSX_DEPLOYMENT_TARGET_X86
162
153
elif target_triple == "x86_64-apple-ios" :
163
154
env ["TARGET_TRIPLE" ] = "x86_64-apple-ios"
164
- arches = ["x86_64" ]
165
155
sdk_platform = "iphonesimulator"
166
156
min_version_flags = [
167
157
"-mios-simulator-version-min=%s" % IPHONEOS_DEPLOYMENT_TARGET ,
168
158
]
169
159
env ["APPLE_MIN_DEPLOYMENT_TARGET" ] = IPHONEOS_DEPLOYMENT_TARGET
170
160
elif target_triple == "x86_64-apple-tvos" :
171
161
env ["TARGET_TRIPLE" ] = "x86_64-apple-tvos"
172
- arches = ["x86_64" ]
173
162
sdk_platform = "appletvsimulator"
174
163
min_version_flags = [
175
164
"-mappletvsimulator-version-min=%s" % TVOS_DEPLOYMENT_TARGET
176
165
]
177
166
env ["APPLE_MIN_DEPLOYMENT_TARGET" ] = TVOS_DEPLOYMENT_TARGET
178
167
elif target_triple == "x86_64-apple-watchos" :
179
168
env ["TARGET_TRIPLE" ] = "x86_64-apple-watchos"
180
- arches = ["x86_64" ]
181
169
sdk_platform = "watchsimulator"
182
170
min_version_flags = [
183
171
"-mwatchsimulator-version-min=%s" % WATCHOS_DEPLOYMENT_TARGET
@@ -203,10 +191,6 @@ def add_target_env(env, build_platform, target_triple, build_env):
203
191
]
204
192
)
205
193
206
- for arch in arches :
207
- extra_target_cflags .extend (["-arch" , arch ])
208
- extra_target_ldflags .extend (["-arch" , arch ])
209
-
210
194
if "APPLE_SDK_PATH" in os .environ :
211
195
sdk_path = os .environ ["APPLE_SDK_PATH" ]
212
196
else :
0 commit comments