From 6a42b3724f2a3eb3de01de6addf023003b64f81c Mon Sep 17 00:00:00 2001 From: Arnaud Mallen Date: Wed, 7 May 2025 11:19:08 +0200 Subject: [PATCH 1/4] 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 d3ebbacbf7380b2c9f8dae81e9f71a184e3a17a5 Mon Sep 17 00:00:00 2001 From: Arnaud Mallen Date: Wed, 7 May 2025 11:37:30 +0200 Subject: [PATCH 2/4] 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 b23a014cad56e77ab8746d31b5ee83cc5b4ae9cf Mon Sep 17 00:00:00 2001 From: Arnaud Mallen Date: Wed, 7 May 2025 11:46:38 +0200 Subject: [PATCH 3/4] 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", [])) From ba7dbec8b2436788c8e2c03fdf3c112731055b27 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20M=C3=BCller?= Date: Thu, 25 Sep 2025 10:37:26 +0200 Subject: [PATCH 4/4] Add standard to swift_c_test --- cc/defs.bzl | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cc/defs.bzl b/cc/defs.bzl index aec0005..757c4d5 100644 --- a/cc/defs.bzl +++ b/cc/defs.bzl @@ -652,7 +652,10 @@ def swift_c_test(name, type, **kwargs): local_includes = _construct_local_includes(kwargs.pop("local_includes", [])) - kwargs["copts"] = local_includes + kwargs.get("copts", []) + _tests_warn_deprecated_declarations() + extensions = kwargs.pop("extensions", False) + standard = kwargs.pop("standard", 99) + + kwargs["copts"] = local_includes + kwargs.get("copts", []) + _tests_warn_deprecated_declarations() + _c_standard(extensions, standard) kwargs["data"] = kwargs.get("data", []) + _symbolizer_data() kwargs["env"] = _symbolizer_env(kwargs.get("env", {})) kwargs["linkstatic"] = kwargs.get("linkstatic", True)