From 66af4f20b703fe94488730ad0a053530fb6e1702 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 372ef3d..52e9b88 100644 --- a/cc/defs.bzl +++ b/cc/defs.bzl @@ -595,8 +595,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 5e96e0b49ff42022b4b511b6ae91a92145d0da5a 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 52e9b88..538f177 100644 --- a/cc/defs.bzl +++ b/cc/defs.bzl @@ -592,14 +592,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 b7bf17b8acc174917eba3a249fedfa68ca7b3827 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 538f177..aec0005 100644 --- a/cc/defs.bzl +++ b/cc/defs.bzl @@ -592,7 +592,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", []))