Skip to content

Commit

Permalink
Revert previous linker additions for FreeBSD as the problem is Bazel …
Browse files Browse the repository at this point in the history
…using /usr/bin/clang instead of /usr/bin/clang++ to link C++ code. (#1035)
  • Loading branch information
yesudeep committed Sep 3, 2020
1 parent 4475ff6 commit 4751550
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 32 deletions.
29 changes: 3 additions & 26 deletions BUILD.bazel
Expand Up @@ -2,35 +2,14 @@ load("@rules_cc//cc:defs.bzl", "cc_library")

licenses(["notice"])

config_setting(
name = "freebsd",
constraint_values = [
"@platforms//os:freebsd",
],
visibility = [":__subpackages__"],
)

config_setting(
name = "openbsd",
constraint_values = [
"@platforms//os:openbsd",
],
visibility = [":__subpackages__"],
)

config_setting(
name = "windows",
constraint_values = [
"@platforms//os:windows",
],
values = {
"cpu": "x64_windows",
},
visibility = [":__subpackages__"],
)

BSD_LINKOPTS = [
"-pthread",
"-lm",
]

cc_library(
name = "benchmark",
srcs = glob(
Expand All @@ -43,8 +22,6 @@ cc_library(
hdrs = ["include/benchmark/benchmark.h"],
linkopts = select({
":windows": ["-DEFAULTLIB:shlwapi.lib"],
":freebsd": BSD_LINKOPTS,
":openbsd": BSD_LINKOPTS,
"//conditions:default": ["-pthread"],
}),
strip_include_prefix = "include",
Expand Down
6 changes: 0 additions & 6 deletions WORKSPACE
Expand Up @@ -34,9 +34,3 @@ new_local_repository(
build_file = "@//bindings/python:python_headers.BUILD",
path = "/usr/include/python3.6", # May be overwritten by setup.py.
)

http_archive(
name = "platforms",
strip_prefix = "platforms-master",
urls = ["https://github.com/bazelbuild/platforms/archive/master.zip"],
)

0 comments on commit 4751550

Please sign in to comment.