Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / third-party / benchmark / bindings / python / build_defs.bzl
blob45907aaa5e2d893e876d9bd1f1148ee704dedf2d
1 _SHARED_LIB_SUFFIX = {
2     "//conditions:default": ".so",
3     "//:windows": ".dll",
6 def py_extension(name, srcs, hdrs = [], copts = [], features = [], deps = []):
7     for shared_lib_suffix in _SHARED_LIB_SUFFIX.values():
8         shared_lib_name = name + shared_lib_suffix
9         native.cc_binary(
10             name = shared_lib_name,
11             linkshared = 1,
12             linkstatic = 1,
13             srcs = srcs + hdrs,
14             copts = copts,
15             features = features,
16             deps = deps,
17         )
19     return native.py_library(
20         name = name,
21         data = select({
22             platform: [name + shared_lib_suffix]
23             for platform, shared_lib_suffix in _SHARED_LIB_SUFFIX.items()
24         }),
25     )