From 3945f9400c9fa00b7447bde47287b931b937fdfd Mon Sep 17 00:00:00 2001 From: Arnaud Mallen Date: Wed, 7 May 2025 11:19:08 +0200 Subject: [PATCH 1/3] Test --- cc/defs.bzl | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/cc/defs.bzl b/cc/defs.bzl index 7a4e854..992dfb6 100644 --- a/cc/defs.bzl +++ b/cc/defs.bzl @@ -599,8 +599,12 @@ def swift_cc_test_library(**kwargs): _ = kwargs.pop("nocopts", []) # To handle API compatibility. local_includes = _construct_local_includes(kwargs.pop("local_includes", [])) + exceptions = kwargs.pop("exceptions", False) + rtti = kwargs.pop("rtti", False) + standard = kwargs.pop("standard", None) - kwargs["copts"] = local_includes + kwargs.get("copts", []) + cxxopts = _common_cxx_opts(exceptions, rtti, standard) + kwargs["copts"] = copts + cxxopts + local_includes + kwargs.get("copts", []) kwargs["tags"] = [TEST_LIBRARY] + kwargs.get("tags", []) From c8ced0fa1189b1fc478da537003063fc78dcd5d1 Mon Sep 17 00:00:00 2001 From: Arnaud Mallen Date: Wed, 7 May 2025 11:37:30 +0200 Subject: [PATCH 2/3] Test --- cc/defs.bzl | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/cc/defs.bzl b/cc/defs.bzl index 992dfb6..8b804e2 100644 --- a/cc/defs.bzl +++ b/cc/defs.bzl @@ -596,14 +596,15 @@ def swift_cc_test_library(**kwargs): be relative to the package this macro is called from. """ - _ = kwargs.pop("nocopts", []) # To handle API compatibility. + nocopts = kwargs.pop("nocopts", []) # pop because nocopts is a deprecated cc* attr. local_includes = _construct_local_includes(kwargs.pop("local_includes", [])) - exceptions = kwargs.pop("exceptions", False) - rtti = kwargs.pop("rtti", False) + standard = kwargs.pop("standard", None) - cxxopts = _common_cxx_opts(exceptions, rtti, standard) + copts = _common_cc_opts(nocopts, pedantic = False) + cxxopts = _common_cxx_standard_opts(standard) + kwargs["copts"] = copts + cxxopts + local_includes + kwargs.get("copts", []) kwargs["tags"] = [TEST_LIBRARY] + kwargs.get("tags", []) From 8345ddb3d5354d24e4d06e36608ed5da83601bec Mon Sep 17 00:00:00 2001 From: Arnaud Mallen Date: Wed, 7 May 2025 11:46:38 +0200 Subject: [PATCH 3/3] Fixes --- cc/defs.bzl | 1 - 1 file changed, 1 deletion(-) diff --git a/cc/defs.bzl b/cc/defs.bzl index 8b804e2..5f39a67 100644 --- a/cc/defs.bzl +++ b/cc/defs.bzl @@ -596,7 +596,6 @@ def swift_cc_test_library(**kwargs): be relative to the package this macro is called from. """ - nocopts = kwargs.pop("nocopts", []) # pop because nocopts is a deprecated cc* attr. local_includes = _construct_local_includes(kwargs.pop("local_includes", []))