meson.build 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. project('boosttest', 'cpp',
  2. default_options : ['cpp_std=c++11'])
  3. add_project_arguments(['-DBOOST_LOG_DYN_LINK'],
  4. language : 'cpp'
  5. )
  6. dep = dependency('boost', required: false)
  7. if not dep.found()
  8. error('MESON_SKIP_TEST boost not found.')
  9. endif
  10. compiler = meson.get_compiler('cpp')
  11. if compiler.has_argument('-permissive')
  12. # boost 1.64, the version we test against, doesn't work with -permissive
  13. add_project_arguments('-permissive', language: 'cpp')
  14. endif
  15. # We want to have multiple separate configurations of Boost
  16. # within one project. The need to be independent of each other.
  17. # Use one without a library dependency and one with it.
  18. linkdep = dependency('boost', modules : ['thread', 'system', 'test'])
  19. staticdep = dependency('boost', modules : ['thread', 'system'], static : true)
  20. testdep = dependency('boost', modules : ['unit_test_framework'])
  21. nomoddep = dependency('boost')
  22. extralibdep = dependency('boost', modules : ['thread', 'system', 'log_setup', 'log'])
  23. linkexe = executable('linkedexe', 'linkexe.cc', dependencies : linkdep)
  24. staticexe = executable('staticlinkedexe', 'linkexe.cc', dependencies : staticdep)
  25. unitexe = executable('utf', 'unit_test.cpp', dependencies: testdep)
  26. nomodexe = executable('nomod', 'nomod.cpp', dependencies : nomoddep)
  27. extralibexe = executable('extralibexe', 'extralib.cpp', dependencies : extralibdep)
  28. test('Boost linktest', linkexe)
  29. test('Boost statictest', staticexe)
  30. test('Boost UTF test', unitexe)
  31. test('Boost nomod', nomodexe)
  32. test('Boost extralib test', extralibexe)
  33. subdir('partial_dep')
  34. # check we can apply a version constraint
  35. dependency('boost', version: '>=@0@'.format(dep.version()))