Skip to content

Commit

Permalink
meson: don't build test programs by default
Browse files Browse the repository at this point in the history
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]>
Message-ID: <[email protected]>
Signed-off-by: David Gibson <[email protected]>
  • Loading branch information
eli-schwartz authored and dgibson committed Mar 3, 2025
1 parent ce1d858 commit 1ccd232
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion tests/meson.build
Original file line number Diff line number Diff line change
@@ -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(
Expand Down Expand Up @@ -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')
Expand Down

0 comments on commit 1ccd232

Please sign in to comment.