Skip to content

Commit b102a4c

Browse files
committed
Only use cc_shared_library if it is enabled
1 parent 2ae238a commit b102a4c

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,18 @@
11
load("@bazel_features//:features.bzl", "bazel_features")
2+
load("@rules_cc//cc/common:cc_common.bzl", "cc_common")
23

34
def maybe_cc_shared_library(name, **kwargs):
45
if _has_cc_shared_library():
56
shared_name = "%s_shared" % name
67
native.cc_shared_library(
78
name = shared_name,
89
deps = [name],
9-
**kwargs,
10+
**kwargs
1011
)
1112
return shared_name
1213
return name
1314

14-
15-
1615
def _has_cc_shared_library():
16+
if hasattr(cc_common, "check_experimental_cc_shared_library"):
17+
return cc_common.check_experimental_cc_shared_library()
1718
return bazel_features.globals.CcSharedLibraryInfo != None

0 commit comments

Comments
 (0)