From b65c07082b0bae8777e07a77692d88217ca4fae8 Mon Sep 17 00:00:00 2001 From: Timothy Flynn Date: Thu, 16 Nov 2023 12:25:58 -0500 Subject: [PATCH] Meta: Properly handle GN unit tests which define their own `deps` If a unit tests defines a `deps` array, the unit test template would have tried to overwrite it (and it is actually an error to overwrite a non-empty list with another non-empty list). --- Meta/gn/secondary/Tests/unittest.gni | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Meta/gn/secondary/Tests/unittest.gni b/Meta/gn/secondary/Tests/unittest.gni index 80d71ec334..0f69135726 100644 --- a/Meta/gn/secondary/Tests/unittest.gni +++ b/Meta/gn/secondary/Tests/unittest.gni @@ -8,7 +8,11 @@ template("unittest") { assert(!defined(invoker.output_dir), "cannot set unittest output_dir") assert(!defined(invoker.testonly), "cannot set unittest testonly") - deps = [ "//AK" ] + if (!defined(invoker.deps)) { + deps = [] + } + + deps += [ "//AK" ] if (has_custom_main) { deps += [ "//Userland/Libraries/LibTest" ] } else if (use_js_main) {