Skip to content

Commit

Permalink
Fix windows_export_all_symbols in cc_shared_library (#15190)
Browse files Browse the repository at this point in the history
  • Loading branch information
oquenchil committed Apr 7, 2022
1 parent ffa2a0b commit 8ae1520
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -388,10 +388,7 @@ def _cc_shared_library_impl(ctx):
feature_configuration = cc_common.configure_features(
ctx = ctx,
cc_toolchain = cc_toolchain,
# This features enables behavior which creates a def file automatically
# for exporting all the symbols in a shared libary on Windows. If a
# custom def file is passed, this behavior doesn't apply.
requested_features = ctx.features + ["windows_export_all_symbols"],
requested_features = ctx.features,
unsupported_features = ctx.disabled_features,
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,18 +36,21 @@ cc_binary(
cc_shared_library(
name = "a_so",
roots = [":a_suffix"],
features = ["windows_export_all_symbols"],
)

cc_shared_library(
name = "diamond_so",
dynamic_deps = [":a_so"],
roots = [":qux"],
features = ["windows_export_all_symbols"],
)

cc_shared_library(
name = "diamond2_so",
dynamic_deps = [":a_so"],
roots = [":qux2"],
features = ["windows_export_all_symbols"],
)

cc_binary(
Expand Down Expand Up @@ -90,6 +93,7 @@ cc_shared_library(
"-Wl,--script=$(location :additional_script.txt)",
],
"//conditions:default": []}),
features = ["windows_export_all_symbols"],
)

cc_library(
Expand Down Expand Up @@ -184,6 +188,7 @@ cc_shared_library(
],
"//conditions:default": [],
}),
features = ["windows_export_all_symbols"],
)

cc_library(
Expand Down Expand Up @@ -309,6 +314,7 @@ cc_shared_library(
roots = [
":direct_so_file_cc_lib",
],
features = ["windows_export_all_symbols"],
)

genrule(
Expand All @@ -330,6 +336,7 @@ cc_shared_library(
":direct_so_file_cc_lib2",
],
shared_lib_name = "renamed_so_file.so",
features = ["windows_export_all_symbols"],
)

cc_library(
Expand Down

0 comments on commit 8ae1520

Please sign in to comment.