From: Kaartic Sivaraam Date: Mon, 05 Oct 2026 09:34:16 GMT Subject: Re: [PATCH 4/7] meson: use precompiled headers for unit tests Message-ID: In-Reply-To: <20260924-pks-meson-improvements-v1-4-90b7f79f1c4e@pks.im> On 9/24/26 19:39, Patrick Steinhardt wrote: > > diff --git a/t/meson.build b/t/meson.build > index 3ca7b27104..9f1ee9ad59 100644 > --- a/t/meson.build > +++ b/t/meson.build > @@ -30,7 +30,6 @@ clar_test_suites = [ > ] > > clar_sources = [ > - 'unit-tests/clar/clar.c', > 'unit-tests/unit-test.c', > 'unit-tests/lib-oid.c', > 'unit-tests/lib-reftable.c' > @@ -49,7 +48,7 @@ clar_decls_h = custom_target( > ) > clar_sources += clar_decls_h > > -clar_sources += custom_target( > +clar_suite_h = custom_target( > input: clar_decls_h, > output: 'clar.suite', > command : [ > @@ -66,6 +65,13 @@ clar_unit_tests = executable('unit-tests', > c_args: [ > '-DGIT_CLAR_DECLS_H="' + clar_decls_h.full_path() + '"', > ], > + c_pch: '../tools/precompiled.h', > + link_with: static_library('clar', > + sources: [ > + 'unit-tests/clar/clar.c', > + clar_suite_h, > + ], > + ), Compiling this separately as a static library is cool but now clar.c does not get the libgit_c_args it was getting through the dependencies of the unit-tests executable. Is this something that we need to correct? > dependencies: [libgit_commonmain], > ) > test('unit-tests', clar_unit_tests, kwargs: test_kwargs) > -- Sivaraam