blob: 973eb1908b32a049c4bad805c02b7e4980558cee [file] [log] [blame]
Marat Dukhan08c4a432019-10-03 09:29:21 -07001"""Build definitions and rules for XNNPACK."""
2
3load(":emscripten.bzl", "xnnpack_emscripten_benchmark_linkopts", "xnnpack_emscripten_deps", "xnnpack_emscripten_minimal_linkopts", "xnnpack_emscripten_test_linkopts")
4
5def xnnpack_visibility():
6 """Visibility of :XNNPACK target.
7
8 All other targets have private visibility, and can not have external
9 dependencies.
10 """
Marat Dukhan9d056a42019-10-03 12:13:35 -070011 return ["//visibility:public"]
Marat Dukhan08c4a432019-10-03 09:29:21 -070012
13def xnnpack_min_size_copts():
14 """Compiler flags for size-optimized builds."""
15 return ["-Os"]
16
Marat Dukhan10a38082020-04-17 03:58:35 -070017def xnnpack_gcc_std_copts():
18 """GCC-like compiler flags to specify language standard for C sources."""
Marat Dukhan08c4a432019-10-03 09:29:21 -070019 return ["-std=c99"]
20
Marat Dukhan10a38082020-04-17 03:58:35 -070021def xnnpack_msvc_std_copts():
22 """MSVC compiler flags to specify language standard for C sources."""
23 return ["/Drestrict="]
24
Marat Dukhan08c4a432019-10-03 09:29:21 -070025def xnnpack_std_cxxopts():
26 """Compiler flags to specify language standard for C++ sources."""
27 return ["-std=gnu++11"]
28
29def xnnpack_optional_ruy_copts():
30 """Compiler flags to optionally enable Ruy benchmarks."""
31 return []
32
33def xnnpack_optional_gemmlowp_copts():
34 """Compiler flags to optionally enable Gemmlowp benchmarks."""
35 return []
36
37def xnnpack_optional_tflite_copts():
38 """Compiler flags to optionally enable TensorFlow Lite benchmarks."""
39 return []
40
41def xnnpack_optional_armcl_copts():
42 """Compiler flags to optionally enable ARM ComputeLibrary benchmarks."""
43 return []
44
Marat Dukhan8d3c6932020-03-06 20:27:27 -080045def xnnpack_optional_dnnl_copts():
46 """Compiler flags to optionally enable Intel DNNL benchmarks."""
47 return []
48
Marat Dukhan08c4a432019-10-03 09:29:21 -070049def xnnpack_optional_ruy_deps():
50 """Optional Ruy dependencies."""
51 return []
52
53def xnnpack_optional_gemmlowp_deps():
54 """Optional Gemmlowp dependencies."""
55 return []
56
57def xnnpack_optional_tflite_deps():
58 """Optional TensorFlow Lite dependencies."""
59 return []
60
61def xnnpack_optional_armcl_deps():
62 """Optional ARM ComputeLibrary dependencies."""
63 return []
64
Marat Dukhan8d3c6932020-03-06 20:27:27 -080065def xnnpack_optional_dnnl_deps():
66 """Optional Intel DNNL dependencies."""
67 return []
68
Marat Dukhan08c4a432019-10-03 09:29:21 -070069def xnnpack_cc_library(
70 name,
71 srcs = [],
Marat Dukhan10a38082020-04-17 03:58:35 -070072 psimd_srcs = [],
Marat Dukhan08c4a432019-10-03 09:29:21 -070073 x86_srcs = [],
74 aarch32_srcs = [],
75 aarch64_srcs = [],
Marat Dukhancf056b22019-10-07 10:26:29 -070076 asmjs_srcs = [],
77 wasm_srcs = [],
78 wasmsimd_srcs = [],
Marat Dukhan08c4a432019-10-03 09:29:21 -070079 copts = [],
Marat Dukhan10a38082020-04-17 03:58:35 -070080 gcc_copts = [],
81 msvc_copts = [],
82 mingw_copts = [],
83 msys_copts = [],
84 gcc_x86_copts = [],
85 msvc_x86_32_copts = [],
86 msvc_x86_64_copts = [],
Marat Dukhanbc69ed62020-06-09 21:34:56 -070087 apple_aarch32_copts = [],
Marat Dukhan08c4a432019-10-03 09:29:21 -070088 aarch32_copts = [],
89 aarch64_copts = [],
Marat Dukhancf056b22019-10-07 10:26:29 -070090 asmjs_copts = [],
91 wasm_copts = [],
92 wasmsimd_copts = [],
Marat Dukhan08c4a432019-10-03 09:29:21 -070093 optimized_copts = ["-O2"],
94 hdrs = [],
Marat Dukhan10a38082020-04-17 03:58:35 -070095 defines = [],
96 includes = [],
97 deps = [],
98 visibility = []):
Marat Dukhancf056b22019-10-07 10:26:29 -070099 """C/C++/assembly library with architecture-specific configuration.
Marat Dukhan08c4a432019-10-03 09:29:21 -0700100
101 Define a static library with architecture- and instruction-specific
Marat Dukhancf056b22019-10-07 10:26:29 -0700102 source files and/or compiler flags.
Marat Dukhan08c4a432019-10-03 09:29:21 -0700103
104 Args:
105 name: The name of the library target to define.
106 srcs: The list of architecture-independent source files.
Marat Dukhan500b8892020-04-15 17:09:50 -0700107 psimd_srcs: The list of psimd-specific source files.
Marat Dukhan08c4a432019-10-03 09:29:21 -0700108 x86_srcs: The list of x86-specific source files.
109 aarch32_srcs: The list of AArch32-specific source files.
110 aarch64_srcs: The list of AArch64-specific source files.
Marat Dukhancf056b22019-10-07 10:26:29 -0700111 asmjs_srcs: The list of Asm.js-specific source files.
112 wasm_srcs: The list of WebAssembly/MVP-specific source files.
113 wasmsimd_srcs: The list of WebAssembly/SIMD-specific source files.
Marat Dukhan08c4a432019-10-03 09:29:21 -0700114 copts: The list of compiler flags to use in all builds. -I flags for
115 include/ and src/ directories of XNNPACK are always prepended
116 before these user-specified flags.
Marat Dukhan10a38082020-04-17 03:58:35 -0700117 gcc_copts: The list of compiler flags to use with GCC-like compilers.
118 msvc_copts: The list of compiler flags to use with MSVC compiler.
119 mingw_copts: The list of compiler flags to use with MinGW GCC compilers.
Marat Dukhanbc69ed62020-06-09 21:34:56 -0700120 msys_copts: The list of compiler flags to use with MSYS (Cygwin) GCC
121 compilers.
122 gcc_x86_copts: The list of GCC-like compiler flags to use in x86 (32-bit
123 and 64-bit) builds.
124 msvc_x86_32_copts: The list of MSVC compiler flags to use in x86 (32-bit)
125 builds.
126 msvc_x86_64_copts: The list of MSVC compiler flags to use in x86 (64-bit)
127 builds.
128 apple_aarch32_copts: The list of compiler flags to use in AArch32 builds
129 with Apple Clang.
Marat Dukhan08c4a432019-10-03 09:29:21 -0700130 aarch32_copts: The list of compiler flags to use in AArch32 builds.
131 aarch64_copts: The list of compiler flags to use in AArch64 builds.
Marat Dukhancf056b22019-10-07 10:26:29 -0700132 asmjs_copts: The list of compiler flags to use in Asm.js builds.
133 wasm_copts: The list of compiler flags to use in WebAssembly/MVP builds.
134 wasmsimd_copts: The list of compiler flags to use in WebAssembly/SIMD
135 builds.
Marat Dukhan08c4a432019-10-03 09:29:21 -0700136 optimized_copts: The list of compiler flags to use in optimized builds.
137 Defaults to -O2.
138 hdrs: The list of header files published by this library to be textually
139 included by sources in dependent rules.
Marat Dukhan10a38082020-04-17 03:58:35 -0700140 defines: List of predefines macros to be added to the compile line.
141 includes: List of include dirs to be added to the compile line.
Marat Dukhan08c4a432019-10-03 09:29:21 -0700142 deps: The list of other libraries to be linked.
Marat Dukhan10a38082020-04-17 03:58:35 -0700143 visibility: The list of packages that can depend on this target.
Marat Dukhan08c4a432019-10-03 09:29:21 -0700144 """
145 native.cc_library(
146 name = name,
147 srcs = srcs + select({
Marat Dukhan500b8892020-04-15 17:09:50 -0700148 ":linux_k8": psimd_srcs + x86_srcs,
Marat Dukhan582094e2020-04-30 17:21:25 -0700149 ":linux_arm": psimd_srcs + aarch32_srcs,
Marat Dukhan500b8892020-04-15 17:09:50 -0700150 ":linux_armhf": psimd_srcs + aarch32_srcs,
Marat Dukhan24567892020-06-10 13:15:48 -0700151 ":linux_armv7a": psimd_srcs + aarch32_srcs,
Marat Dukhan582094e2020-04-30 17:21:25 -0700152 ":linux_aarch64": psimd_srcs + aarch64_srcs,
Marat Dukhan500b8892020-04-15 17:09:50 -0700153 ":macos_x86_64": psimd_srcs + x86_srcs,
Marat Dukhan10a38082020-04-17 03:58:35 -0700154 ":windows_x86_64_clang": psimd_srcs + x86_srcs,
155 ":windows_x86_64_mingw": psimd_srcs + x86_srcs,
156 ":windows_x86_64_msys": psimd_srcs + x86_srcs,
157 ":windows_x86_64": x86_srcs,
Marat Dukhan500b8892020-04-15 17:09:50 -0700158 ":android_armv7": psimd_srcs + aarch32_srcs,
159 ":android_arm64": psimd_srcs + aarch64_srcs,
160 ":android_x86": psimd_srcs + x86_srcs,
161 ":android_x86_64": psimd_srcs + x86_srcs,
162 ":ios_armv7": psimd_srcs + aarch32_srcs,
163 ":ios_arm64": psimd_srcs + aarch64_srcs,
164 ":ios_arm64e": psimd_srcs + aarch64_srcs,
165 ":ios_x86": psimd_srcs + x86_srcs,
166 ":ios_x86_64": psimd_srcs + x86_srcs,
167 ":watchos_armv7k": psimd_srcs + aarch32_srcs,
168 ":watchos_arm64_32": psimd_srcs + aarch64_srcs,
169 ":watchos_x86": psimd_srcs + x86_srcs,
170 ":watchos_x86_64": psimd_srcs + x86_srcs,
171 ":tvos_arm64": psimd_srcs + aarch64_srcs,
172 ":tvos_x86_64": psimd_srcs + x86_srcs,
Marat Dukhancf056b22019-10-07 10:26:29 -0700173 ":emscripten_asmjs": asmjs_srcs,
174 ":emscripten_wasm": wasm_srcs,
Marat Dukhan500b8892020-04-15 17:09:50 -0700175 ":emscripten_wasmsimd": psimd_srcs + wasmsimd_srcs,
Marat Dukhan08c4a432019-10-03 09:29:21 -0700176 "//conditions:default": [],
177 }),
178 copts = [
179 "-Iinclude",
180 "-Isrc",
181 ] + copts + select({
Marat Dukhan10a38082020-04-17 03:58:35 -0700182 ":linux_k8": gcc_x86_copts,
Marat Dukhan582094e2020-04-30 17:21:25 -0700183 ":linux_arm": aarch32_copts,
Terry Heo68eef3f2020-04-13 22:53:52 -0700184 ":linux_armhf": aarch32_copts,
Marat Dukhan24567892020-06-10 13:15:48 -0700185 ":linux_armv7a": aarch32_copts,
Marat Dukhan582094e2020-04-30 17:21:25 -0700186 ":linux_aarch64": aarch64_copts,
Marat Dukhan10a38082020-04-17 03:58:35 -0700187 ":macos_x86_64": gcc_x86_copts,
188 ":windows_x86_64_clang": ["/clang:" + opt for opt in gcc_x86_copts],
189 ":windows_x86_64_mingw": mingw_copts + gcc_x86_copts,
190 ":windows_x86_64_msys": msys_copts + gcc_x86_copts,
191 ":windows_x86_64": msvc_x86_64_copts,
Marat Dukhan08c4a432019-10-03 09:29:21 -0700192 ":android_armv7": aarch32_copts,
193 ":android_arm64": aarch64_copts,
Marat Dukhan10a38082020-04-17 03:58:35 -0700194 ":android_x86": gcc_x86_copts,
195 ":android_x86_64": gcc_x86_copts,
Marat Dukhanbc69ed62020-06-09 21:34:56 -0700196 ":ios_armv7": apple_aarch32_copts,
Marat Dukhan1498d1d2020-02-11 20:00:05 -0800197 ":ios_arm64": aarch64_copts,
198 ":ios_arm64e": aarch64_copts,
Marat Dukhan10a38082020-04-17 03:58:35 -0700199 ":ios_x86": gcc_x86_copts,
200 ":ios_x86_64": gcc_x86_copts,
Marat Dukhanbc69ed62020-06-09 21:34:56 -0700201 ":watchos_armv7k": apple_aarch32_copts,
Marat Dukhan1498d1d2020-02-11 20:00:05 -0800202 ":watchos_arm64_32": aarch64_copts,
Marat Dukhan10a38082020-04-17 03:58:35 -0700203 ":watchos_x86": gcc_x86_copts,
204 ":watchos_x86_64": gcc_x86_copts,
Marat Dukhan1498d1d2020-02-11 20:00:05 -0800205 ":tvos_arm64": aarch64_copts,
Marat Dukhan10a38082020-04-17 03:58:35 -0700206 ":tvos_x86_64": gcc_x86_copts,
Marat Dukhancf056b22019-10-07 10:26:29 -0700207 ":emscripten_asmjs": asmjs_copts,
208 ":emscripten_wasm": wasm_copts,
209 ":emscripten_wasmsimd": wasmsimd_copts,
Marat Dukhan08c4a432019-10-03 09:29:21 -0700210 "//conditions:default": [],
211 }) + select({
Marat Dukhan10a38082020-04-17 03:58:35 -0700212 ":windows_x86_64_clang": ["/clang:" + opt for opt in gcc_copts],
213 ":windows_x86_64_mingw": gcc_copts,
214 ":windows_x86_64_msys": gcc_copts,
215 ":windows_x86_64": msvc_copts,
216 "//conditions:default": gcc_copts,
217 }) + select({
Marat Dukhan08c4a432019-10-03 09:29:21 -0700218 ":optimized_build": optimized_copts,
219 "//conditions:default": [],
220 }),
Marat Dukhan10a38082020-04-17 03:58:35 -0700221 defines = defines,
222 deps = deps,
223 includes = ["include", "src"] + includes,
Marat Dukhan08c4a432019-10-03 09:29:21 -0700224 linkstatic = True,
225 linkopts = select({
226 ":linux_k8": ["-lpthread"],
Marat Dukhan582094e2020-04-30 17:21:25 -0700227 ":linux_arm": ["-lpthread"],
Terry Heo68eef3f2020-04-13 22:53:52 -0700228 ":linux_armhf": ["-lpthread"],
Marat Dukhan24567892020-06-10 13:15:48 -0700229 ":linux_armv7a": ["-lpthread"],
Marat Dukhan582094e2020-04-30 17:21:25 -0700230 ":linux_aarch64": ["-lpthread"],
Marat Dukhan08c4a432019-10-03 09:29:21 -0700231 ":android": ["-lm"],
232 "//conditions:default": [],
233 }),
234 textual_hdrs = hdrs,
Marat Dukhan10a38082020-04-17 03:58:35 -0700235 visibility = visibility,
Marat Dukhan08c4a432019-10-03 09:29:21 -0700236 )
237
238def xnnpack_aggregate_library(
239 name,
240 generic_deps = [],
Marat Dukhan500b8892020-04-15 17:09:50 -0700241 psimd_deps = [],
Marat Dukhan08c4a432019-10-03 09:29:21 -0700242 x86_deps = [],
243 aarch32_deps = [],
244 aarch64_deps = [],
245 wasm_deps = [],
246 wasmsimd_deps = []):
247 """Static library that aggregates architecture-specific dependencies.
248
249 Args:
250 name: The name of the library target to define.
251 generic_deps: The list of libraries to link on all architectures.
Marat Dukhan500b8892020-04-15 17:09:50 -0700252 psimd_deps: The list of libraries to link in psimd-enabled builds.
Marat Dukhan08c4a432019-10-03 09:29:21 -0700253 x86_deps: The list of libraries to link in x86 and x86-64 builds.
254 aarch32_deps: The list of libraries to link in AArch32 builds.
255 aarch64_deps: The list of libraries to link in AArch32 builds.
256 wasm_deps: The list of libraries to link in WebAssembly (MVP) builds.
257 wasmsimd_deps: The list of libraries to link in WebAssembly SIMD builds.
258 """
259
260 native.cc_library(
261 name = name,
262 linkstatic = True,
263 deps = generic_deps + select({
Marat Dukhan500b8892020-04-15 17:09:50 -0700264 ":linux_k8": psimd_deps + x86_deps,
Marat Dukhan582094e2020-04-30 17:21:25 -0700265 ":linux_arm": psimd_deps + aarch32_deps,
Marat Dukhan500b8892020-04-15 17:09:50 -0700266 ":linux_armhf": psimd_deps + aarch32_deps,
Marat Dukhan24567892020-06-10 13:15:48 -0700267 ":linux_armv7a": psimd_deps + aarch32_deps,
Marat Dukhan582094e2020-04-30 17:21:25 -0700268 ":linux_aarch64": psimd_deps + aarch64_deps,
Marat Dukhan500b8892020-04-15 17:09:50 -0700269 ":macos_x86_64": psimd_deps + x86_deps,
Marat Dukhan10a38082020-04-17 03:58:35 -0700270 ":windows_x86_64_clang": psimd_deps + x86_deps,
271 ":windows_x86_64_mingw": psimd_deps + x86_deps,
272 ":windows_x86_64_msys": psimd_deps + x86_deps,
273 ":windows_x86_64": x86_deps,
Marat Dukhan500b8892020-04-15 17:09:50 -0700274 ":android_armv7": psimd_deps + aarch32_deps,
275 ":android_arm64": psimd_deps + aarch64_deps,
276 ":android_x86": psimd_deps + x86_deps,
277 ":android_x86_64": psimd_deps + x86_deps,
278 ":ios_armv7": psimd_deps + aarch32_deps,
279 ":ios_arm64": psimd_deps + aarch64_deps,
280 ":ios_arm64e": psimd_deps + aarch64_deps,
281 ":ios_x86": psimd_deps + x86_deps,
282 ":ios_x86_64": psimd_deps + x86_deps,
283 ":watchos_armv7k": psimd_deps + aarch32_deps,
284 ":watchos_arm64_32": psimd_deps + aarch64_deps,
285 ":watchos_x86": psimd_deps + x86_deps,
286 ":watchos_x86_64": psimd_deps + x86_deps,
287 ":tvos_arm64": psimd_deps + aarch64_deps,
288 ":tvos_x86_64": psimd_deps + x86_deps,
Marat Dukhan08c4a432019-10-03 09:29:21 -0700289 ":emscripten_wasm": wasm_deps,
Marat Dukhan500b8892020-04-15 17:09:50 -0700290 ":emscripten_wasmsimd": psimd_deps + wasmsimd_deps,
Marat Dukhan08c4a432019-10-03 09:29:21 -0700291 ":emscripten_asmjs": [],
292 }),
293 )
294
Marat Dukhan22eed3d2020-05-11 20:13:37 -0700295def xnnpack_unit_test(name, srcs, copts = [], mingw_copts = [], msys_copts = [], deps = [], tags = [], automatic = True):
Marat Dukhan08c4a432019-10-03 09:29:21 -0700296 """Unit test binary based on Google Test.
297
298 Args:
299 name: The name of the test target to define.
300 srcs: The list of source and header files.
301 copts: The list of additional compiler flags for the target. -I flags
302 for include/ and src/ directories of XNNPACK are always prepended
303 before these user-specified flags.
Marat Dukhan10a38082020-04-17 03:58:35 -0700304 mingw_copts: The list of compiler flags to use with MinGW GCC compilers.
305 msys_copts: The list of compiler flags to use with MSYS (Cygwin) GCC compilers.
Marat Dukhan08c4a432019-10-03 09:29:21 -0700306 deps: The list of additional libraries to be linked. Google Test library
307 (with main() function) is always added as a dependency and does not
308 need to be explicitly specified.
309 """
310
Marat Dukhan22eed3d2020-05-11 20:13:37 -0700311 if automatic:
312 native.cc_test(
313 name = name,
314 srcs = srcs,
315 copts = xnnpack_std_cxxopts() + [
316 "-Iinclude",
317 "-Isrc",
318 ] + select({
319 ":windows_x86_64_mingw": mingw_copts,
320 ":windows_x86_64_msys": msys_copts,
321 "//conditions:default": [],
322 }) + select({
323 ":windows_x86_64_clang": ["/clang:-Wno-unused-function"],
324 ":windows_x86_64_mingw": ["-Wno-unused-function"],
325 ":windows_x86_64_msys": ["-Wno-unused-function"],
326 ":windows_x86_64": [],
327 "//conditions:default": ["-Wno-unused-function"],
328 }) + copts,
329 linkopts = select({
330 ":emscripten": xnnpack_emscripten_test_linkopts(),
331 "//conditions:default": [],
332 }),
333 linkstatic = True,
334 deps = [
335 "@com_google_googletest//:gtest_main",
336 ] + deps + select({
337 ":emscripten": xnnpack_emscripten_deps(),
338 "//conditions:default": [],
339 }),
340 tags = tags,
341 )
342 else:
343 native.cc_binary(
344 name = name,
345 srcs = srcs,
346 copts = xnnpack_std_cxxopts() + [
347 "-Iinclude",
348 "-Isrc",
349 ] + select({
350 ":windows_x86_64_mingw": mingw_copts,
351 ":windows_x86_64_msys": msys_copts,
352 "//conditions:default": [],
353 }) + select({
354 ":windows_x86_64_clang": ["/clang:-Wno-unused-function"],
355 ":windows_x86_64_mingw": ["-Wno-unused-function"],
356 ":windows_x86_64_msys": ["-Wno-unused-function"],
357 ":windows_x86_64": [],
358 "//conditions:default": ["-Wno-unused-function"],
359 }) + copts,
360 linkopts = select({
361 ":emscripten": xnnpack_emscripten_test_linkopts(),
362 "//conditions:default": [],
363 }),
364 linkstatic = True,
365 deps = [
366 "@com_google_googletest//:gtest_main",
367 ] + deps + select({
368 ":emscripten": xnnpack_emscripten_deps(),
369 "//conditions:default": [],
370 }),
371 testonly = True,
372 tags = tags,
373 )
Marat Dukhan08c4a432019-10-03 09:29:21 -0700374
375def xnnpack_binary(name, srcs, copts = [], deps = []):
376 """Minimal binary
377
378 Args:
379 name: The name of the binary target to define.
380 srcs: The list of source and header files.
381 copts: The list of additional compiler flags for the target. -I flags
382 for include/ and src/ directories of XNNPACK are always prepended
383 before these user-specified flags.
384 deps: The list of libraries to be linked.
385 """
386 native.cc_binary(
387 name = name,
388 srcs = srcs,
389 copts = [
390 "-Iinclude",
391 "-Isrc",
392 ] + copts,
393 linkopts = select({
394 ":emscripten": xnnpack_emscripten_minimal_linkopts(),
395 "//conditions:default": [],
396 }),
397 linkstatic = True,
398 deps = deps,
399 )
400
Marat Dukhana98efa12020-05-04 17:07:49 -0700401def xnnpack_benchmark(name, srcs, copts = [], deps = [], tags = []):
Marat Dukhan08c4a432019-10-03 09:29:21 -0700402 """Microbenchmark binary based on Google Benchmark
403
404 Args:
405 name: The name of the binary target to define.
406 srcs: The list of source and header files.
407 copts: The list of additional compiler flags for the target. -I flags
408 for include/ and src/ directories of XNNPACK are always prepended
409 before these user-specified flags.
410 deps: The list of additional libraries to be linked. Google Benchmark
411 library is always added as a dependency and does not need to be
412 explicitly specified.
413 """
414 native.cc_binary(
415 name = name,
416 srcs = srcs,
417 copts = xnnpack_std_cxxopts() + [
418 "-Iinclude",
419 "-Isrc",
Marat Dukhana98efa12020-05-04 17:07:49 -0700420 ] + select({
421 ":windows_x86_64_clang": ["/clang:-Wno-unused-function"],
422 ":windows_x86_64_mingw": ["-Wno-unused-function"],
423 ":windows_x86_64_msys": ["-Wno-unused-function"],
424 ":windows_x86_64": [],
425 "//conditions:default": ["-Wno-unused-function"],
426 }) + copts,
Marat Dukhan08c4a432019-10-03 09:29:21 -0700427 linkopts = select({
428 ":emscripten": xnnpack_emscripten_benchmark_linkopts(),
Marat Dukhan10a38082020-04-17 03:58:35 -0700429 ":windows_x86_64_mingw": ["-lshlwapi"],
430 ":windows_x86_64_msys": ["-lshlwapi"],
Marat Dukhan08c4a432019-10-03 09:29:21 -0700431 "//conditions:default": [],
432 }),
433 linkstatic = True,
434 deps = [
435 "@com_google_benchmark//:benchmark",
436 ] + deps + select({
437 ":emscripten": xnnpack_emscripten_deps(),
438 "//conditions:default": [],
439 }),
Marat Dukhan8ea0b072020-04-23 16:12:18 -0700440 tags = tags,
Marat Dukhan08c4a432019-10-03 09:29:21 -0700441 )