Skip to content

Commit

Permalink
tools: Use alwayslink instead of legacy_whole_archive
Browse files Browse the repository at this point in the history
  • Loading branch information
jwnimmer-tri committed Oct 29, 2019
1 parent eef0357 commit 7872689
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
3 changes: 2 additions & 1 deletion common/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ load(
"drake_cc_googletest",
"drake_cc_library",
"drake_cc_package_library",
"drake_cc_test",
)
load(
"@drake//tools/skylark:drake_py.bzl",
Expand Down Expand Up @@ -714,7 +715,7 @@ drake_cc_googletest(
)

# Functional test of DRAKE_ASSERT at compile time.
drake_cc_googletest(
drake_cc_test(
name = "drake_assert_test_compile",
deps = [
":essential",
Expand Down
4 changes: 0 additions & 4 deletions tools/bazel.rc
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,6 @@ import %workspace%/tools/lint/bazel.rc
# than a toolchain in Bazel 0.27 and above until #11660 is resolved.
build --incompatible_use_python_toolchains=false

# Continue to use --whole-archive for cc_binary rules that have linkshared = 1
# and either linkstatic = 1 or -static in linkopts in Bazel 1.0 and above.
build --incompatible_remove_legacy_whole_archive=false

# Default to an optimized build.
build -c opt

Expand Down
2 changes: 2 additions & 0 deletions tools/skylark/drake_cc.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -352,6 +352,7 @@ def drake_cc_library(
clang_copts = [],
gcc_copts = [],
linkstatic = 1,
alwayslink = 1,
declare_installed_headers = 1,
install_hdrs_exclude = [],
**kwargs):
Expand Down Expand Up @@ -389,6 +390,7 @@ def drake_cc_library(
deps = new_deps,
copts = new_copts,
linkstatic = linkstatic,
alwayslink = alwayslink,
declare_installed_headers = declare_installed_headers,
install_hdrs_exclude = install_hdrs_exclude,
**kwargs
Expand Down
1 change: 1 addition & 0 deletions tools/skylark/pybind.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,7 @@ def drake_pybind_cc_googletest(
"@pybind11",
"@python//:python_direct_link",
],
use_default_main = False,
# Add 'manual', because we only want to run it with Python present.
tags = ["manual"] + tags,
visibility = visibility,
Expand Down

0 comments on commit 7872689

Please sign in to comment.