summaryrefslogtreecommitdiff
path: root/fuzz/meson.build
diff options
context:
space:
mode:
authorJohn Turner <jturner.usa@gmail.com>2025-11-16 20:31:19 +0000
committerJohn Turner <jturner.usa@gmail.com>2025-11-16 20:31:19 +0000
commit424bd9d0720e3752c6ff252c6eb0a3425109b765 (patch)
treebfb82632bd55df717333addff11895cce6c36a5b /fuzz/meson.build
parent7c404ca8c5d0037a17797ace2961d5424cf3a4a5 (diff)
downloadgentoo-utils-424bd9d0720e3752c6ff252c6eb0a3425109b765.tar.gz
move fuzz stuff into its own directory
Diffstat (limited to 'fuzz/meson.build')
-rw-r--r--fuzz/meson.build27
1 files changed, 27 insertions, 0 deletions
diff --git a/fuzz/meson.build b/fuzz/meson.build
new file mode 100644
index 0000000..c4b5e8d
--- /dev/null
+++ b/fuzz/meson.build
@@ -0,0 +1,27 @@
+cbindgen = find_program('cbindgen')
+
+fuzz_h = custom_target(
+ 'fuzz_h',
+ input: 'fuzz.rs',
+ output: 'fuzz.h',
+ command: [cbindgen, '@INPUT@', '-o', '@OUTPUT'],
+)
+
+fuzz_rs = static_library(
+ 'fuzz_rs',
+ 'fuzz.rs',
+ rust_abi: 'c',
+ rust_args: [
+ '-Cpasses=sancov-module',
+ '-Cllvm-args=-sanitizer-coverage-level=3',
+ '-Cllvm-args=-sanitizer-coverage-inline-8bit-counters',
+ ],
+ dependencies: [mon],
+ link_with: [gentoo_utils],
+)
+
+fuzz_cpp = executable(
+ 'fuzz',
+ link_args: ['-fsanitize=fuzzer'],
+ link_with: [fuzz_rs],
+)