mirror of
https://github.com/google/benchmark.git
synced 2024-11-29 09:36:49 +00:00
38b767e58a
* Don't link pthread on QNX On QNX, pthread is part of libc [1]. There's no separate pthread library to link. [1] https://www.qnx.com/developers/docs/7.1/index.html#com.qnx.doc.neutrino.lib_ref/topic/p/pthread_create.html * Explain that QNX doesn't have pthread lib
55 lines
1.2 KiB
Python
55 lines
1.2 KiB
Python
load("@rules_cc//cc:defs.bzl", "cc_library")
|
|
|
|
licenses(["notice"])
|
|
|
|
config_setting(
|
|
name = "qnx",
|
|
constraint_values = ["@platforms//os:qnx"],
|
|
values = {
|
|
"cpu": "x64_qnx",
|
|
},
|
|
visibility = [":__subpackages__"],
|
|
)
|
|
|
|
config_setting(
|
|
name = "windows",
|
|
constraint_values = ["@platforms//os:windows"],
|
|
values = {
|
|
"cpu": "x64_windows",
|
|
},
|
|
visibility = [":__subpackages__"],
|
|
)
|
|
|
|
cc_library(
|
|
name = "benchmark",
|
|
srcs = glob(
|
|
[
|
|
"src/*.cc",
|
|
"src/*.h",
|
|
],
|
|
exclude = ["src/benchmark_main.cc"],
|
|
),
|
|
hdrs = ["include/benchmark/benchmark.h"],
|
|
linkopts = select({
|
|
":windows": ["-DEFAULTLIB:shlwapi.lib"],
|
|
"//conditions:default": ["-pthread"],
|
|
}),
|
|
strip_include_prefix = "include",
|
|
visibility = ["//visibility:public"],
|
|
)
|
|
|
|
cc_library(
|
|
name = "benchmark_main",
|
|
srcs = ["src/benchmark_main.cc"],
|
|
hdrs = ["include/benchmark/benchmark.h"],
|
|
strip_include_prefix = "include",
|
|
visibility = ["//visibility:public"],
|
|
deps = [":benchmark"],
|
|
)
|
|
|
|
cc_library(
|
|
name = "benchmark_internal_headers",
|
|
hdrs = glob(["src/*.h"]),
|
|
visibility = ["//test:__pkg__"],
|
|
)
|