-
Notifications
You must be signed in to change notification settings - Fork 4.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bazel: similar build flags to cmake for corresponding build types (#4… #720
Changes from 5 commits
7cebb0e
2423d5f
63a3b1c
b55e524
f47df63
1a75897
4969692
b28d32e
619dd3c
e4baffe
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,18 @@ | ||
package(default_visibility = ["//visibility:public"]) | ||
|
||
exports_files(["gen_sh_test_runner.sh"]) | ||
|
||
config_setting( | ||
name = "opt_build", | ||
values = {"compilation_mode": "opt"}, | ||
) | ||
|
||
config_setting( | ||
name = "fastbuild_build", | ||
values = {"compilation_mode": "fastbuild"}, | ||
) | ||
|
||
config_setting( | ||
name = "dbg_build", | ||
values = {"compilation_mode": "dbg"}, | ||
) |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,22 +3,19 @@ load("@protobuf_git//:protobuf.bzl", "cc_proto_library") | |
ENVOY_COPTS = [ | ||
# TODO(htuch): Remove this when Bazel bringup is done. | ||
"-DBAZEL_BRINGUP", | ||
"-fno-omit-frame-pointer", | ||
# TODO(htuch): Clang wants -ferror-limit, should support both. Commented out for now. | ||
# "-fmax-errors=3", | ||
"-Wall", | ||
# TODO(htuch): Figure out why protobuf-3.2.0 causes the CI build to fail | ||
# with this but not the developer-local build. | ||
#"-Wextra", | ||
"-Wextra", | ||
"-Werror", | ||
"-Wnon-virtual-dtor", | ||
"-Woverloaded-virtual", | ||
# TODO(htuch): Figure out how to use this in the presence of headers in | ||
# openssl/tclap which use old style casts. | ||
# "-Wold-style-cast", | ||
"-Wold-style-cast", | ||
"-std=c++0x", | ||
"-includeprecompiled/precompiled.h", | ||
] | ||
] + select({ | ||
"//bazel:opt_build": [], | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. -DNDEBUG? Still need debug symbols? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Bazel automatically sets There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think DEBUG is just habit from previous jobs. I don't think we use it anywhere and I agree it's silly. Let's just kill it. Can you grep for it though just to make sure we don't use it anywhere? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Confirmed it's not used, switching to NDEBUG only. |
||
"//bazel:fastbuild_build": ["-DDEBUG"], | ||
"//bazel:dbg_build": ["-ggdb3", "-DDEBUG"], | ||
}) | ||
|
||
# References to Envoy external dependencies should be wrapped with this function. | ||
def envoy_external_dep_path(dep): | ||
|
@@ -70,6 +67,8 @@ def envoy_cc_binary(name, | |
linkopts = [ | ||
"-pthread", | ||
"-lrt", | ||
"-static-libstdc++", | ||
"-static-libgcc", | ||
], | ||
linkstatic = 1, | ||
visibility = visibility, | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this default in bazel?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep.