File: meson.build

package info (click to toggle)
libspng 0.7.4-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,532 kB
  • sloc: ansic: 7,896; sh: 39; makefile: 22; cpp: 14
file content (51 lines) | stat: -rw-r--r-- 1,184 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
if get_option('dev_build') == false
    subdir_done()
endif

add_languages('cpp', native : false)
cpp = meson.get_compiler('cpp')

fuzzer_args = []

if cc.has_function('fmemopen', prefix : '#include <stdio.h>', args : '-D_GNU_SOURCE')
    fuzzer_args = [ '-D_GNU_SOURCE', '-DSPNGT_HAVE_FMEMOPEN' ]
endif

read_fuzzer = executable('fuzz_repro',
    'fuzz_main.c',
    'spng_read_fuzzer.c',
    c_args : fuzzer_args,
    link_with : spng_lib
)

write_fuzzer_exe = executable('fuzz_write_repro',
    'fuzz_main.c',
    'spng_write_fuzzer.c',
    c_args : fuzzer_args,
    link_with : spng_lib
)

png_dep = dependency('libpng', version : '>=1.6.0', fallback : ['libpng', 'png_dep'])

test_deps = [ spng_dep, png_dep ]

test_exe = executable('testsuite', 'testsuite.c', dependencies : test_deps)

test('info', test_exe, args : 'info')

cpp_exe = executable('cpp_exe', 'test.cpp', dependencies : spng_dep)
test('cpp_test', cpp_exe)

subdir('images')
subdir('crashers')
subdir('misc')

if get_option('oss_fuzz') == false
    subdir_done()
endif

corpora = subproject('fuzzing_corpora').get_variable('corpora')

foreach case : corpora
    test('testcase', read_fuzzer, args : case)
endforeach