meson.build 870 B

12345678910111213141516171819202122232425262728293031
  1. # libSRTP fuzzer
  2. if not add_languages('cpp', required: get_option('fuzzer').enabled())
  3. subdir_done()
  4. endif
  5. cxx = meson.get_compiler('cpp')
  6. if cxx.get_id() != 'clang'
  7. err_msg = 'libSRTP fuzzer requires compilation with clang, but compiler is ' + cxx.get_id()
  8. if get_option('fuzzer').enabled()
  9. error(err_msg)
  10. else
  11. warning(err_msg)
  12. subdir_done()
  13. endif
  14. endif
  15. libfuzzer = cxx.find_library('libFuzzer', required: get_option('fuzzer'))
  16. # libFuzzer.a seems to need pthread, at least on Linux
  17. threads = dependency('threads')
  18. if libfuzzer.found()
  19. executable('srtp-fuzzer',
  20. 'fuzzer.c', 'testmem.c', 'mt19937.cpp',
  21. include_directories: [config_incs, crypto_incs, srtp2_incs],
  22. cpp_args: ['-fsanitize=fuzzer'],
  23. override_options : ['cpp_std=c++11'],
  24. dependencies: [libfuzzer, threads],
  25. link_with: libsrtp2,
  26. install: false)
  27. endif