Merge pull request #36264 from wdirons:fix_flatbuffers_link_error

PiperOrigin-RevId: 291844926
Change-Id: Idc4251ef1b014e395a5fedebdc371954d5cb5876
This commit is contained in:
TensorFlower Gardener 2020-01-27 18:38:41 -08:00
commit eaa8aca44a

View File

@ -8,6 +8,17 @@ exports_files(["LICENSE.txt"])
licenses(["notice"])
config_setting(
name = "freebsd",
values = {"cpu": "freebsd"},
visibility = ["//visibility:public"],
)
config_setting(
name = "windows",
values = {"cpu": "x64_windows"},
)
load("@rules_cc//cc:defs.bzl", "cc_binary", "cc_library")
# Public flatc library to compile flatbuffer files at runtime.
@ -50,6 +61,16 @@ cc_library(
# Public flatc compiler.
cc_binary(
name = "flatc",
linkopts = select({
":freebsd": [
"-lm",
],
":windows": [],
"//conditions:default": [
"-lm",
"-ldl",
],
}),
deps = [
"@flatbuffers//src:flatc",
],