1
1
# -*- mode: cmake -*-
2
+ % # Ignore the following warning. This _is_ the correct file to edit.
2
3
################################################################################
3
4
# WARNING: This file is automatically generated from templates and should not
4
- # be directly modified. Instead, make changes to
5
- # scripts/generate_harness/CMakeLists.txt_template and run
5
+ # be directly modified. Instead, make changes to CMakeLists.text.gyb and run
6
6
# scripts/generate_harness/generate_harness.py to regenerate this file.
7
7
################################################################################
8
+ %{
9
+ from gyb_benchmark_support import (
10
+ tests,
11
+ multisource_benches
12
+ )
13
+ }%
8
14
9
15
cmake_minimum_required (VERSION 2.8.12 )
10
16
11
17
# Add path for custom CMake modules.
12
18
list (APPEND CMAKE_MODULE_PATH
13
- "${CMAKE_CURRENT_SOURCE_DIR} /cmake/modules" )
19
+ "$$ {CMAKE_CURRENT_SOURCE_DIR} /cmake/modules" )
14
20
15
21
include (AddSwiftBenchmarkSuite )
16
22
17
23
set (SWIFT_BENCH_MODULES
18
- { % for test in tests %}
19
- single-source/{{ test } }
20
- {% endfor %}
24
+ % for test in tests:
25
+ single-source/${ test}
26
+ % end
21
27
)
22
28
23
29
set (SWIFT_MULTISOURCE_BENCHES
24
- { % for multisource_bench in multisource_benches %}
25
- multi-source/{{ multisource_bench.name } }
26
- {% endfor %}
30
+ % for multisource_bench in multisource_benches:
31
+ multi-source/${ multisource_bench.name}
32
+ % end
27
33
)
28
34
29
- { % for multisource_bench in multisource_benches %}
30
- set ({{ multisource_bench.name } }_sources
31
- {% for file in multisource_bench.files %}
32
- multi-source/{{ multisource_bench.name }}/{{ file } }
33
- {% endfor %}
35
+ % for multisource_bench in multisource_benches:
36
+ set (${ multisource_bench.name}_sources
37
+ % for file in multisource_bench.files:
38
+ multi-source/${ multisource_bench.name}/${ file}
39
+ % end
34
40
)
35
41
36
- {% endfor %}
42
+ % end
37
43
38
44
set (BENCH_DRIVER_LIBRARY_MODULES
39
45
utils/DriverUtils
@@ -62,19 +68,19 @@ if(NOT SWIFT_EXEC)
62
68
endif ()
63
69
64
70
if (NOT SWIFT_LIBRARY_PATH )
65
- get_filename_component (tmp_dir "${SWIFT_EXEC} " DIRECTORY )
66
- get_filename_component (tmp_dir "${tmp_dir} " DIRECTORY )
67
- set (SWIFT_LIBRARY_PATH "${tmp_dir} /lib/swift" )
71
+ get_filename_component (tmp_dir "$$ {SWIFT_EXEC} " DIRECTORY )
72
+ get_filename_component (tmp_dir "$$ {tmp_dir} " DIRECTORY )
73
+ set (SWIFT_LIBRARY_PATH "$$ {tmp_dir} /lib/swift" )
68
74
endif ()
69
75
70
76
# If the CMAKE_C_COMPILER is already clang, don't find it again,
71
77
# thus allowing the --host-cc build-script argument to work here.
72
- get_filename_component (c_compiler ${CMAKE_C_COMPILER} NAME )
78
+ get_filename_component (c_compiler $$ {CMAKE_C_COMPILER} NAME )
73
79
74
- if (${c_compiler} STREQUAL "clang" )
75
- set (CLANG_EXEC ${CMAKE_C_COMPILER} )
80
+ if ($$ {c_compiler} STREQUAL "clang" )
81
+ set (CLANG_EXEC $$ {CMAKE_C_COMPILER} )
76
82
else ()
77
- runcmd (COMMAND "xcrun" "-toolchain" "${SWIFT_DARWIN_XCRUN_TOOLCHAIN} " "-f" "clang"
83
+ runcmd (COMMAND "xcrun" "-toolchain" "$$ {SWIFT_DARWIN_XCRUN_TOOLCHAIN} " "-f" "clang"
78
84
VARIABLE CLANG_EXEC
79
85
ERROR "Unable to find Clang driver" )
80
86
endif ()
@@ -90,7 +96,7 @@ Available configurations: <Optlevel>_SINGLEFILE, <Optlevel>_MULTITHREADED")
90
96
# where "_<configuration>" is optional.
91
97
if (NOT SWIFT_OPTIMIZATION_LEVELS )
92
98
set (SWIFT_OPTIMIZATION_LEVELS "Onone" "O" "Ounchecked"
93
- ${SWIFT_EXTRA_BENCH_CONFIGS} )
99
+ $$ {SWIFT_EXTRA_BENCH_CONFIGS} )
94
100
endif ()
95
101
96
102
set (SWIFT_BENCHMARK_NUM_O_ITERATIONS "" CACHE STRING
@@ -123,30 +129,30 @@ set(watchos_triple_platform "watchos")
123
129
124
130
set (sdks )
125
131
set (platforms )
126
- foreach (platform ${ONLY_PLATFORMS} )
132
+ foreach (platform $$ {ONLY_PLATFORMS} )
127
133
execute_process (
128
- COMMAND "xcrun" "--sdk" "${platform} " "--show-sdk-path"
129
- OUTPUT_VARIABLE ${platform} _sdk
134
+ COMMAND "xcrun" "--sdk" "$$ {platform} " "--show-sdk-path"
135
+ OUTPUT_VARIABLE $$ {platform}_sdk
130
136
RESULT_VARIABLE result
131
137
ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE )
132
- if ("${result} " MATCHES "0" )
133
- list (APPEND sdks "${ ${platform} _sdk}" )
134
- list (APPEND platforms ${platform} )
138
+ if ("$$ {result} " MATCHES "0" )
139
+ list (APPEND sdks "$${$ ${platform} _sdk}" )
140
+ list (APPEND platforms $$ {platform} )
135
141
endif ()
136
142
endforeach ()
137
143
138
144
message ("--" )
139
145
message ("-- Swift Benchmark Suite:" )
140
- message ("-- SWIFT_EXEC = ${SWIFT_EXEC} " )
141
- message ("-- SWIFT_LIBRARY_PATH = ${SWIFT_LIBRARY_PATH} " )
142
- message ("-- CLANG_EXEC = ${CLANG_EXEC} " )
143
- message ("-- SWIFT_OPTIMIZATION_LEVELS = ${SWIFT_OPTIMIZATION_LEVELS} " )
144
- message ("-- ONLY_PLATFORMS = ${ONLY_PLATFORMS} " )
146
+ message ("-- SWIFT_EXEC = $$ {SWIFT_EXEC} " )
147
+ message ("-- SWIFT_LIBRARY_PATH = $$ {SWIFT_LIBRARY_PATH} " )
148
+ message ("-- CLANG_EXEC = $$ {CLANG_EXEC} " )
149
+ message ("-- SWIFT_OPTIMIZATION_LEVELS = $$ {SWIFT_OPTIMIZATION_LEVELS} " )
150
+ message ("-- ONLY_PLATFORMS = $$ {ONLY_PLATFORMS} " )
145
151
146
- message ("-- found platforms: ${platforms} " )
152
+ message ("-- found platforms: $$ {platforms} " )
147
153
message ("-- found sdks:" )
148
- foreach (sdk ${sdks} )
149
- message ("-- ${sdk} " )
154
+ foreach (sdk $$ {sdks} )
155
+ message ("-- $$ {sdk} " )
150
156
endforeach ()
151
157
152
158
set (executable_targets )
@@ -155,27 +161,26 @@ if(SWIFT_SDKS)
155
161
set (IS_SWIFT_BUILD true )
156
162
endif ()
157
163
158
- set (srcdir "${CMAKE_CURRENT_SOURCE_DIR} " )
164
+ set (srcdir "$$ {CMAKE_CURRENT_SOURCE_DIR} " )
159
165
160
166
if (IS_SWIFT_BUILD )
161
- get_filename_component (swift-bin-dir "${SWIFT_EXEC} " DIRECTORY )
167
+ get_filename_component (swift-bin-dir "$$ {SWIFT_EXEC} " DIRECTORY )
162
168
else ()
163
- set (swift-bin-dir "${CMAKE_BINARY_DIR} /bin" )
169
+ set (swift-bin-dir "$$ {CMAKE_BINARY_DIR} /bin" )
164
170
endif ()
165
171
166
- set (benchmark-bin-dir "${CMAKE_CURRENT_BINARY_DIR} /bin" )
167
- set (benchmark-lib-dir "${CMAKE_CURRENT_BINARY_DIR} /lib" )
168
- set (benchmark-lib-swift-dir "${CMAKE_CURRENT_BINARY_DIR} /lib/swift" )
172
+ set (benchmark-bin-dir "$$ {CMAKE_CURRENT_BINARY_DIR} /bin" )
173
+ set (benchmark-lib-dir "$$ {CMAKE_CURRENT_BINARY_DIR} /lib" )
174
+ set (benchmark-lib-swift-dir "$$ {CMAKE_CURRENT_BINARY_DIR} /lib/swift" )
169
175
170
- file (MAKE_DIRECTORY "${swift-bin-dir}" )
171
- file (MAKE_DIRECTORY "${benchmark-bin-dir}" )
172
- file (MAKE_DIRECTORY "${benchmark-lib-dir}" )
173
- file (MAKE_DIRECTORY "${benchmark-lib-swift-dir}" )
176
+ file (MAKE_DIRECTORY "$$ {swift-bin-dir}" )
177
+ file (MAKE_DIRECTORY "$$ {benchmark-bin-dir}" )
178
+ file (MAKE_DIRECTORY "$$ {benchmark-lib-dir}" )
179
+ file (MAKE_DIRECTORY "$$ {benchmark-lib-swift-dir}" )
174
180
175
181
# Compile the perf test suite for each platform
176
- foreach (platform ${platforms} )
177
- swift_benchmark_compile (PLATFORM ${platform} )
182
+ foreach (platform $$ {platforms} )
183
+ swift_benchmark_compile (PLATFORM $$ {platform} )
178
184
endforeach ()
179
185
180
186
add_subdirectory (scripts )
181
-
0 commit comments