From b102a4cbddfa5fbf4408a55bbf6a1ada8cb340ac Mon Sep 17 00:00:00 2001 From: Claudio Bley Date: Mon, 18 Nov 2024 09:26:16 +0100 Subject: [PATCH] Only use cc_shared_library if it is enabled --- .../hs_lib_repl_test/maybe_cc_shared_library.bzl | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/rules_haskell_tests/tests/repl-targets/hs_lib_repl_test/maybe_cc_shared_library.bzl b/rules_haskell_tests/tests/repl-targets/hs_lib_repl_test/maybe_cc_shared_library.bzl index a738c3b6d..fd51cdfa8 100644 --- a/rules_haskell_tests/tests/repl-targets/hs_lib_repl_test/maybe_cc_shared_library.bzl +++ b/rules_haskell_tests/tests/repl-targets/hs_lib_repl_test/maybe_cc_shared_library.bzl @@ -1,4 +1,5 @@ load("@bazel_features//:features.bzl", "bazel_features") +load("@rules_cc//cc/common:cc_common.bzl", "cc_common") def maybe_cc_shared_library(name, **kwargs): if _has_cc_shared_library(): @@ -6,12 +7,12 @@ def maybe_cc_shared_library(name, **kwargs): native.cc_shared_library( name = shared_name, deps = [name], - **kwargs, + **kwargs ) return shared_name return name - - def _has_cc_shared_library(): + if hasattr(cc_common, "check_experimental_cc_shared_library"): + return cc_common.check_experimental_cc_shared_library() return bazel_features.globals.CcSharedLibraryInfo != None