From 9e3fb4ea940ee67bb4669cc199db7b575bf34f69 Mon Sep 17 00:00:00 2001 From: Yesudeep Mangalapilly Date: Fri, 8 Oct 2021 08:55:39 -0700 Subject: [PATCH] Fix linker errors on FreeBSD. --- BUILD.bazel | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/BUILD.bazel b/BUILD.bazel index 3b25878a..1df5ff5f 100644 --- a/BUILD.bazel +++ b/BUILD.bazel @@ -46,6 +46,16 @@ config_setting( constraint_values = ["@platforms//os:windows"], ) +config_setting( + name = "freebsd", + constraint_values = ["@platforms//os:freebsd"], +) + +config_setting( + name = "openbsd", + constraint_values = ["@platforms//os:openbsd"], +) + config_setting( name = "msvc_compiler", flag_values = { @@ -110,6 +120,8 @@ cc_library( linkopts = select({ ":qnx": ["-lregex"], ":windows": [], + ":freebsd": ["-lm", "-pthread"], + ":openbsd": ["-lm", "-pthread"], "//conditions:default": ["-pthread"], }), deps = select({