@@ -21,6 +21,10 @@ endif()
21
21
22
22
include (AddSwiftBenchmarkSuite )
23
23
24
+ #===-----------------------------------------------------------------------===#
25
+ # Declarative Description of Benchmarks
26
+ #===-----------------------------------------------------------------------===#
27
+
24
28
set (SWIFT_BENCH_MODULES
25
29
single-source/Ackermann
26
30
single-source/AngryPhonebook
@@ -186,37 +190,9 @@ set(BENCH_DRIVER_LIBRARY_MODULES
186
190
utils/DriverUtils
187
191
)
188
192
189
- add_definitions (-DSWIFT_EXEC -DSWIFT_LIBRARY_PATH -DONLY_PLATFORMS
190
- -DSWIFT_OPTIMIZATION_LEVELS -DSWIFT_BENCHMARK_EMIT_SIB )
191
-
192
- if (NOT ONLY_PLATFORMS )
193
- set (ONLY_PLATFORMS "macosx" "iphoneos" "appletvos" "watchos" )
194
- endif ()
195
-
196
- if (NOT SWIFT_EXEC )
197
- runcmd (COMMAND "xcrun" "-f" "swiftc"
198
- VARIABLE SWIFT_EXEC
199
- ERROR "Unable to find Swift driver" )
200
- endif ()
201
-
202
- if (NOT SWIFT_LIBRARY_PATH )
203
- get_filename_component (tmp_dir "${SWIFT_EXEC} " DIRECTORY )
204
- get_filename_component (tmp_dir "${tmp_dir} " DIRECTORY )
205
- set (SWIFT_LIBRARY_PATH "${tmp_dir} /lib/swift" )
206
- endif ()
207
-
208
- # If the CMAKE_C_COMPILER is already clang, don't find it again,
209
- # thus allowing the --host-cc build-script argument to work here.
210
- get_filename_component (c_compiler ${CMAKE_C_COMPILER} NAME )
211
-
212
- if (${c_compiler} STREQUAL "clang" )
213
- set (CLANG_EXEC ${CMAKE_C_COMPILER} )
214
- else ()
215
- runcmd (COMMAND "xcrun" "-toolchain" "${SWIFT_DARWIN_XCRUN_TOOLCHAIN} " "-f" "clang"
216
- VARIABLE CLANG_EXEC
217
- ERROR "Unable to find Clang driver" )
218
- endif ()
219
-
193
+ #===-----------------------------------------------------------------------===#
194
+ # Build Configuration
195
+ #===-----------------------------------------------------------------------===#
220
196
221
197
# You have to delete CMakeCache.txt in the swift build to force a
222
198
# reconfiguration.
@@ -273,34 +249,17 @@ set(BENCHOPTS_MULTITHREADED
273
249
"-whole-module-optimization" "-num-threads" "4" )
274
250
set (BENCHOPTS_SINGLEFILE "" )
275
251
276
- set (macosx_arch "x86_64" )
277
- set (iphoneos_arch "arm64" "armv7" )
278
- set (appletvos_arch "arm64" )
279
- set (watchos_arch "armv7k" )
280
-
281
- set (macosx_ver "10.9" )
282
- set (iphoneos_ver "8.0" )
283
- set (appletvos_ver "9.1" )
284
- set (watchos_ver "2.0" )
285
-
286
- set (macosx_triple_platform "macosx" )
287
- set (iphoneos_triple_platform "ios" )
288
- set (appletvos_triple_platform "tvos" )
289
- set (watchos_triple_platform "watchos" )
290
-
291
- set (sdks )
292
- set (platforms )
293
- foreach (platform ${ONLY_PLATFORMS} )
294
- execute_process (
295
- COMMAND "xcrun" "--sdk" "${platform} " "--show-sdk-path"
296
- OUTPUT_VARIABLE ${platform} _sdk
297
- RESULT_VARIABLE result
298
- ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE )
299
- if ("${result} " MATCHES "0" )
300
- list (APPEND sdks "${${platform} _sdk}" )
301
- list (APPEND platforms ${platform} )
302
- endif ()
303
- endforeach ()
252
+ configure_build ()
253
+
254
+ #===-----------------------------------------------------------------------===#
255
+ # SDK Configuration
256
+ #===-----------------------------------------------------------------------===#
257
+
258
+ configure_sdks ()
259
+
260
+ #===---------------------------------------------------------------------===#
261
+ # Statement of Configuration for Build Users
262
+ #===---------------------------------------------------------------------===#
304
263
305
264
message ("--" )
306
265
message ("-- Swift Benchmark Suite:" )
@@ -318,6 +277,10 @@ foreach(sdk ${sdks})
318
277
message ("-- ${sdk} " )
319
278
endforeach ()
320
279
280
+ #===---------------------------------------------------------------------===#
281
+ # Build Rule Generation
282
+ #===---------------------------------------------------------------------===#
283
+
321
284
set (executable_targets )
322
285
323
286
set (srcdir "${CMAKE_CURRENT_SOURCE_DIR} " )
0 commit comments