Polish Bazel build scripts (#6424)

* Polish Bazel build scripts

* Remove glog references from streaming_logging.cc

* Move out COPTS and reference them

* Disable streaming on Windows

* Remove -fno-gnu-unique
This commit is contained in:
mehrdadn
2019-12-17 02:38:36 -08:00
committed by Philipp Moritz
parent 9d6e03aba0
commit 7a24144bfd
4 changed files with 46 additions and 50 deletions
+13 -6
View File
@@ -2,6 +2,19 @@ load("@com_github_google_flatbuffers//:build_defs.bzl", "flatbuffer_library_publ
load("@com_github_checkstyle_java//checkstyle:checkstyle.bzl", "checkstyle_test")
load("@bazel_common//tools/maven:pom_file.bzl", "pom_file")
# TODO(mehrdadn): (How to) support dynamic linking?
PROPAGATED_WINDOWS_DEFINES = ["RAY_STATIC"]
COPTS = ["-DRAY_USE_GLOG"] + select({
"@bazel_tools//src/conditions:windows": [
"-DWIN32_LEAN_AND_MEAN=", # Block the inclusion of WinSock.h, which is obsolete and causes errors
"-Wno-builtin-macro-redefined", # To get rid of warnings caused by deterministic build macros (e.g. #define __DATE__ "redacted")
"-Wno-microsoft-unqualified-friend", # This shouldn't normally be enabled, but otherwise we get: google/protobuf/map_field.h: warning: unqualified friend declaration referring to type outside of the nearest enclosing namespace is a Microsoft extension; add a nested name specifier (for: friend class DynamicMessage)
] + ["-D" + define for define in PROPAGATED_WINDOWS_DEFINES],
"//conditions:default": [
],
})
def flatbuffer_py_library(name, srcs, outs, out_prefix, includes = [], include_paths = []):
flatbuffer_library_public(
name = name,
@@ -64,9 +77,3 @@ def define_java_module(
"{auto_gen_header}": "<!-- This file is auto-generated by Bazel from pom_template.xml, do not modify it. -->",
},
)
def if_linux_x86_64(a):
return select({
"//:linux_x86_64": a,
"//conditions:default": [],
})