2024-02-03 04:40:06 +00:00
|
|
|
incdir = include_directories('../')
|
|
|
|
|
2024-06-15 20:19:03 +00:00
|
|
|
add_languages('cpp', native: false)
|
|
|
|
|
2024-06-24 14:22:21 +00:00
|
|
|
fuzzers = []
|
|
|
|
|
|
|
|
fuzzers += executable('fuzzer_loadfile_direct', 'fuzzer_loadfile_direct.c',
|
|
|
|
link_language: 'cpp', include_directories: incdir, link_with: libmpv)
|
2024-02-03 04:40:06 +00:00
|
|
|
|
2024-06-17 18:27:57 +00:00
|
|
|
protocols = ['edl', 'file', 'lavf', 'memory']
|
2024-06-16 03:28:13 +00:00
|
|
|
demuxers = ['mkv']
|
2024-05-15 16:21:54 +00:00
|
|
|
|
2024-05-15 12:19:05 +00:00
|
|
|
if features['cdda']
|
|
|
|
protocols += ['cdda']
|
|
|
|
endif
|
|
|
|
if features['dvbin']
|
|
|
|
protocols += ['dvb']
|
|
|
|
endif
|
|
|
|
if features['dvdnav']
|
|
|
|
# TODO: This needs folder structure to load.
|
|
|
|
protocols += ['dvd']
|
|
|
|
endif
|
|
|
|
if features['libbluray']
|
|
|
|
# TODO: This needs folder structure to load.
|
|
|
|
protocols += ['bd']
|
|
|
|
endif
|
|
|
|
if features['libarchive']
|
|
|
|
protocols += ['archive']
|
2024-05-15 16:21:54 +00:00
|
|
|
demuxers += ['libarchive']
|
2024-05-15 12:19:05 +00:00
|
|
|
endif
|
|
|
|
|
|
|
|
foreach p : protocols
|
2024-06-24 14:22:21 +00:00
|
|
|
fuzzers += executable('fuzzer_protocol_' + p,
|
|
|
|
'fuzzer_loadfile_direct.c',
|
|
|
|
link_language: 'cpp',
|
|
|
|
c_args: ['-DMPV_PROTO=' + p, '-DMPV_PROTO_' + p.to_upper()],
|
|
|
|
include_directories: incdir,
|
|
|
|
link_with: libmpv)
|
2024-02-03 04:40:06 +00:00
|
|
|
endforeach
|
|
|
|
|
2024-05-15 16:21:54 +00:00
|
|
|
foreach demuxer : demuxers
|
|
|
|
cmd = 'file'
|
|
|
|
cmd_ = cmd.underscorify()
|
|
|
|
demuxer_ = demuxer.underscorify()
|
2024-06-24 14:22:21 +00:00
|
|
|
fuzzers += executable('fuzzer_load' + cmd_ + '_' + demuxer_,
|
|
|
|
'fuzzer_load.c',
|
|
|
|
link_language: 'cpp',
|
|
|
|
c_args: ['-DMPV_LOAD="' + cmd + '"', '-DMPV_LOAD' + cmd_.to_upper(),
|
|
|
|
'-DMPV_DEMUXER="' + demuxer + '"', '-DMPV_DEMUXER' + demuxer_.to_upper()],
|
|
|
|
include_directories: incdir,
|
|
|
|
link_with: libmpv)
|
2024-05-15 16:21:54 +00:00
|
|
|
endforeach
|
2024-02-03 04:40:06 +00:00
|
|
|
|
|
|
|
foreach f : ['MPV_FORMAT_STRING', 'MPV_FORMAT_FLAG', 'MPV_FORMAT_INT64', 'MPV_FORMAT_DOUBLE']
|
|
|
|
foreach i : ['0', '1']
|
2024-06-24 14:22:21 +00:00
|
|
|
fuzzers += executable('fuzzer_set_property_' + f + '_' + i,
|
|
|
|
'fuzzer_set_property.c',
|
|
|
|
link_language: 'cpp',
|
|
|
|
c_args: ['-DMPV_FORMAT=' + f, '-DMPV_RUN=' + i],
|
|
|
|
include_directories: incdir,
|
|
|
|
link_with: libmpv)
|
2024-02-03 04:40:06 +00:00
|
|
|
endforeach
|
|
|
|
endforeach
|
2024-05-08 15:07:48 +00:00
|
|
|
|
2024-05-15 15:44:08 +00:00
|
|
|
foreach cmd : ['file', '-config-file', '-input-conf']
|
2024-06-24 14:22:21 +00:00
|
|
|
fuzzers += executable('fuzzer_load' + cmd.underscorify(),
|
|
|
|
'fuzzer_load.c',
|
|
|
|
link_language: 'cpp',
|
|
|
|
c_args: ['-DMPV_LOAD="' + cmd + '"', '-DMPV_LOAD' + cmd.underscorify().to_upper()],
|
|
|
|
include_directories: incdir,
|
|
|
|
link_with: libmpv)
|
2024-05-08 15:07:48 +00:00
|
|
|
endforeach
|
2024-06-24 14:22:21 +00:00
|
|
|
|
|
|
|
alias_target('fuzzers', fuzzers)
|