Re: [PATCH] meson: don't build test programs by default

David Gibson <[email protected]>
Newsgroups org.kernel.vger.devicetree-compiler
Message-ID <Z8UMPUk9h5ieMWr0@zatzit>
On Sun, Mar 02, 2025 at 05:28:26PM -0500, Eli Schwartz wrote:
> They are only used when running tests, and are included as depedencies
> of the test cases themselves already. Marking them to not build by
> default, means that 291 compile edges can be skipped when only running
> 
> ```
> meson setup builddir/
> ninja -C builddir/
> meson install -C builddir/
> ```
> 
> resulting in an overall much faster build. Instead they will be compiled
> on-demand by `meson test`, only for users that actually run the tests.
> 
> Signed-off-by: Eli Schwartz <[email protected]>

This also matches the behaviour of the legacy Makefiles.

Merged, thanks.

> ---
>  tests/meson.build | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/tests/meson.build b/tests/meson.build
> index 9cf6e3d..f1044b9 100644
> --- a/tests/meson.build
> +++ b/tests/meson.build
> @@ -1,7 +1,9 @@
>  trees = static_library('trees', files('trees.S'), c_args: '-D__ASSEMBLY__',
> +                       build_by_default: false,
>                         include_directories: libfdt_inc)
>  
>  dumptrees = executable('dumptrees', files('dumptrees.c'),
> +                       build_by_default: false,
>                         link_with: trees, dependencies: libfdt_dep)
>  
>  dumptrees_dtb = custom_target(
> @@ -111,7 +113,7 @@ endif
>  
>  tests_exe = []
>  foreach t: tests
> -  tests_exe += executable(t, files(t + '.c'), dependencies: test_deps, link_args: extra_link_args)
> +  tests_exe += executable(t, files(t + '.c'), dependencies: test_deps, link_args: extra_link_args, build_by_default: false)
>  endforeach
>  
>  run_tests = find_program('run_tests.sh')

-- 
David Gibson (he or they)	| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you, not the other way
				| around.
http://www.ozlabs.org/~dgibson
signature.asc (application/pgp-signature, 833 B)
-----BEGIN PGP SIGNATURE-----

iQIzBAEBCAAdFiEEO+dNsU4E3yXUXRK2zQJF27ox2GcFAmfFDDgACgkQzQJF27ox
2Ge3fQ/8Dwaft6DtxoDwcQKoIOQ8RVI9lgo5Nx49UBYWNWPuBoQ5JQcQNmVbfU/A
aykf5UUo+3RLd7t/gyTAZHUfSN5d5MAlequPUmbpmLq3BphDjlKdq50Vc7L3iJE3
HjTEcIzrWm+AS8JjmYZAMMGU+FcUfu+HlBJs3Ob1yxdMBERFFpRtMF/tWHYnStXy
JwZdALVr7XLt7r9hc+vTNN5pljnxqv98D11Tkdx9i65Ofk+W+yX1TyEvryeeCf/9
pn22UaVttr8jNYRkTEGDvfyx5wXjHNEPLTGHfB5TwcpBVVbty3mx+aU8q6vYPFKE
8VG9+iiMvT7OJ4qDN/LguAY/x2Ysf1VOGrDKJOh4RuOpS7Gfs2Wpc7+zNqgPBA4M
2Ds/ySGGL+DBMOwrQlgNOsnI4YFFvYr5HG7940trsB1k67obYvB8fAtYWEj8bqH8
Z9I732IKX00Vuxa6//XHRTzwHx0UKERiWIIAtqPFRgA9ecb/Uo/zNuTPF7puD9nb
1GZ/44CA3XTSTMd1ba04ApW/1udeecDhkhDwBeAER6LYwYHv5Qk8a2pkrWCgX4Xa
Ow9zXwvjfnQUj5nPnYU662qFegNvXInzeCTw1FvGAaqDT6HY4ZgZ4iBLff6QiicJ
YWRfTnJzvKnAmuibuL2xct5XpOjRckbP9h4LprzASXDyl9EwRzE=
=BQ0I
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.