potatOS-for-linux/tools
Daan De Meyer 6350d2dbd9 meson: Extract objects instead of creating intermediate static libraries
Currently, when we want to add unit tests for code that is compiled into
an executable, we either compile the code at least twice (once for the
executable, and once for each test that uses it) or we create a static
library which is then used by both the executable and all the tests.

Both of these options are not ideal, compiling source files more than
once slows down the build for no reason and creating the intermediate
static libraries takes a lot of boilerplate.

Instead, let's use the extract_objects() method that meson exposes on
build targets. This allows us to extract the objects corresponding to
specific source files and use them in other executables. Because we
define all executables upfront into a dictionary, we integrate this into
the dictionary approach by adding two new fields:

- 'extract' takes a list of files for which objects should be extracted.
  The extracted objects are stored in a dict keyed by the executable name
  from which they were extracted.
- 'objects' takes the name of an executable from which the extracted
  objects should be added to the current executable.

One side effect of this approach is that we can't build test executables
anymore without building the main executable, so we stop building test
executables unless we're also building the main executable. This allows
us to switch to using subdir_done() in all of these subdirectories to skip
parsing them if the corresponding component is disabled.

These changes get me down from 2439 => 2403 ninja targets on a full rebuild
from scratch.
2025-05-12 13:35:50 +02:00
..
chromiumos hwdb: import newest autosuspend rules from chromeos 2024-11-01 12:32:06 +00:00
analyze-dump-sort.py tools: pylint analyze-dump-sort.py 2023-08-10 18:13:29 +02:00
catalog-report.py tools: pylint catalog-report.py 2023-08-10 11:08:17 +02:00
check-api-docs.sh Change all fixed-path bash shebangs to /u/b/env bash outside test/ 2021-12-12 21:13:50 +01:00
check-efi-alignment.py efi: skip check-alignment-* tests if pefile is not installed 2024-03-27 02:32:42 +09:00
check-help.sh test/check-help: check that --help and -h are identical 2022-04-05 22:18:31 +02:00
check-version-history.py tools/check-version-history: avoid DeprecationWarning with newer lxml 2025-03-25 17:16:16 +01:00
check-version.sh tests: add a smoke test for --version option in binaries 2022-04-05 22:18:31 +02:00
command_ignorelist boot: add an option to control action after SecureBoot enrollment () 2025-05-08 13:28:41 +09:00
coverity.sh ci: simplify the Coverity script a bit 2022-08-11 10:57:25 +02:00
dbus_exporter.py tools/dbus_exporter: set LD_ORIGIN_PATH if procfs is not available 2025-02-20 10:46:23 +00:00
dbus_ignorelist man: add basic documents for org.freedesktop.timesync1 2024-09-11 04:42:50 +09:00
debug-sd-boot.sh tools: add loongarch64 to debug-sd-boot script 2025-01-25 01:25:38 +00:00
dump-auxv.py tools: pylint dump-auxv.py 2023-08-10 18:13:29 +02:00
elf2efi.py elf2efi: Add back python 3.7 compat 2025-04-16 13:06:27 +02:00
fetch-distro.py mkosi: Make MinimumVersion= a git commit 2025-04-08 18:35:04 +02:00
fetch-mkosi.py ci: Use mkosi in linter workflow 2025-04-23 15:27:49 +02:00
find-build-dir.sh tools: shellcheck-ify most of the tool scripts 2021-04-20 20:11:13 +02:00
find-double-newline.sh tools: shellcheck-ify most of the tool scripts 2021-04-20 20:11:13 +02:00
find-tabs.sh tools: shellcheck-ify most of the tool scripts 2021-04-20 20:11:13 +02:00
function_ignorelist man: add checks for missing version information 2023-10-01 11:54:29 +01:00
gdb-sd_dump_hashmaps.py hashmap: Drop debug params 2025-05-06 10:14:26 +02:00
generate-gperfs.py shared: Make sure ip-protocol-xxx.h headers include <netinet/in.h> 2025-05-01 16:58:10 +02:00
git-contrib.sh git-contrib: use 'git shortlog' command 2024-04-03 10:07:54 +09:00
git-setup.sh mkosi: Replace submodules with our own thing 2024-05-30 19:31:32 +02:00
list-discoverable-partitions.py tools: pylint list-discoverable-partitions.py 2023-08-10 18:13:29 +02:00
make-autosuspend-rules.py tools: pylint make-autosuspend-rules.py 2023-08-10 18:13:29 +02:00
make-directive-index.py tools: pylint make-directive-index.py 2023-08-10 18:13:29 +02:00
make-man-index.py man: make ID valid 2023-12-25 10:40:40 +01:00
meson-build.sh tools: drop workaround for CentOS 7 2025-01-07 02:05:12 +09:00
meson-extract-unit-files.py test: verify our own units (where applicable) 2024-02-20 15:45:50 +01:00
meson-render-jinja2.py meson: allow to customize the access mode for tty/pts devices 2024-12-16 21:36:07 +00:00
oss-fuzz.sh meson: Extract objects instead of creating intermediate static libraries 2025-05-12 13:35:50 +02:00
sync-docs.py doc-sync: strip point release from version before uploading 2024-09-10 20:20:01 +02:00
update-dbus-docs.py man: drop whitespace from final <programlisting> lines 2024-11-08 14:14:36 +01:00
update-hwdb-autosuspend.sh tools: update-hwdb-autosuspend.sh: Point at HEAD, not master branch 2023-08-16 02:07:00 +01:00
update-hwdb.sh hwdb: rename .html=>.csv 2023-11-15 15:21:26 +01:00
update-man-rules.py update-man-rules: skip over standard-conf.xml 2024-01-04 15:02:28 +01:00
update-syscall-tables.sh tools: syscall tables moved to a subdirectory 2023-11-01 14:07:54 +00:00
vcs-tag.sh meson: Use custom_target() instead of vcs_tag() 2025-04-09 16:21:08 +02:00
xml_helper.py tools: pylint xml_helper.py 2023-08-10 18:13:29 +02:00