[OptTable] Fix typo VALUE => VALUES (NFCI) (#121523)
[llvm-project.git] / third-party / benchmark / bindings / python / build_defs.bzl
blobb0c1b0f5807e3ade9333ceedda6458e354c24f80
1 """
2 This file contains some build definitions for C++ extensions used in the Google Benchmark Python bindings.
3 """
5 _SHARED_LIB_SUFFIX = {
6     "//conditions:default": ".so",
7     "//:windows": ".dll",
10 def py_extension(name, srcs, hdrs = [], copts = [], features = [], deps = []):
11     for shared_lib_suffix in _SHARED_LIB_SUFFIX.values():
12         shared_lib_name = name + shared_lib_suffix
13         native.cc_binary(
14             name = shared_lib_name,
15             linkshared = True,
16             linkstatic = True,
17             srcs = srcs + hdrs,
18             copts = copts,
19             features = features,
20             deps = deps,
21         )
23     return native.py_library(
24         name = name,
25         data = select({
26             platform: [name + shared_lib_suffix]
27             for platform, shared_lib_suffix in _SHARED_LIB_SUFFIX.items()
28         }),
29     )