@@ -199,38 +199,6 @@ set(BENCH_DRIVER_LIBRARY_MODULES
199
199
# Build Configuration
200
200
#===-----------------------------------------------------------------------===#
201
201
202
- add_definitions (-DSWIFT_EXEC -DSWIFT_LIBRARY_PATH -DONLY_PLATFORMS
203
- -DSWIFT_OPTIMIZATION_LEVELS -DSWIFT_BENCHMARK_EMIT_SIB )
204
-
205
- if (NOT ONLY_PLATFORMS )
206
- set (ONLY_PLATFORMS "macosx" "iphoneos" "appletvos" "watchos" )
207
- endif ()
208
-
209
- if (NOT SWIFT_EXEC )
210
- runcmd (COMMAND "xcrun" "-f" "swiftc"
211
- VARIABLE SWIFT_EXEC
212
- ERROR "Unable to find Swift driver" )
213
- endif ()
214
-
215
- if (NOT SWIFT_LIBRARY_PATH )
216
- get_filename_component (tmp_dir "${SWIFT_EXEC} " DIRECTORY )
217
- get_filename_component (tmp_dir "${tmp_dir} " DIRECTORY )
218
- set (SWIFT_LIBRARY_PATH "${tmp_dir} /lib/swift" )
219
- endif ()
220
-
221
- # If the CMAKE_C_COMPILER is already clang, don't find it again,
222
- # thus allowing the --host-cc build-script argument to work here.
223
- get_filename_component (c_compiler ${CMAKE_C_COMPILER} NAME )
224
-
225
- if (${c_compiler} STREQUAL "clang" )
226
- set (CLANG_EXEC ${CMAKE_C_COMPILER} )
227
- else ()
228
- runcmd (COMMAND "xcrun" "-toolchain" "${SWIFT_DARWIN_XCRUN_TOOLCHAIN} " "-f" "clang"
229
- VARIABLE CLANG_EXEC
230
- ERROR "Unable to find Clang driver" )
231
- endif ()
232
-
233
-
234
202
# You have to delete CMakeCache.txt in the swift build to force a
235
203
# reconfiguration.
236
204
set (SWIFT_EXTRA_BENCH_CONFIGS CACHE STRING
@@ -286,38 +254,13 @@ set(BENCHOPTS_MULTITHREADED
286
254
"-whole-module-optimization" "-num-threads" "4" )
287
255
set (BENCHOPTS_SINGLEFILE "" )
288
256
257
+ configure_build ()
258
+
289
259
#===-----------------------------------------------------------------------===#
290
260
# SDK Configuration
291
261
#===-----------------------------------------------------------------------===#
292
262
293
- set (macosx_arch "x86_64" )
294
- set (iphoneos_arch "arm64" "armv7" )
295
- set (appletvos_arch "arm64" )
296
- set (watchos_arch "armv7k" )
297
-
298
- set (macosx_ver "10.9" )
299
- set (iphoneos_ver "8.0" )
300
- set (appletvos_ver "9.1" )
301
- set (watchos_ver "2.0" )
302
-
303
- set (macosx_triple_platform "macosx" )
304
- set (iphoneos_triple_platform "ios" )
305
- set (appletvos_triple_platform "tvos" )
306
- set (watchos_triple_platform "watchos" )
307
-
308
- set (sdks )
309
- set (platforms )
310
- foreach (platform ${ONLY_PLATFORMS} )
311
- execute_process (
312
- COMMAND "xcrun" "--sdk" "${platform} " "--show-sdk-path"
313
- OUTPUT_VARIABLE ${platform} _sdk
314
- RESULT_VARIABLE result
315
- ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE )
316
- if ("${result} " MATCHES "0" )
317
- list (APPEND sdks "${${platform} _sdk}" )
318
- list (APPEND platforms ${platform} )
319
- endif ()
320
- endforeach ()
263
+ configure_sdks ()
321
264
322
265
#===---------------------------------------------------------------------===#
323
266
# Statement of Configuration for Build Users
0 commit comments