meson.build 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. project('rlottie',
  2. 'cpp',
  3. default_options : ['warning_level=3', 'werror=true', 'cpp_std=c++14', 'optimization=s'],
  4. version : '0.0.1',
  5. license : 'Apache')
  6. add_project_arguments('-DDEMO_DIR="@0@/example/resource/"'.format(meson.current_source_dir()), language : 'cpp')
  7. inc = [include_directories('inc')]
  8. config_dir = include_directories('.')
  9. inc += config_dir
  10. config_h = configuration_data()
  11. if get_option('thread') == true
  12. config_h.set10('LOTTIE_THREAD_SUPPORT', true)
  13. endif
  14. if get_option('module') == true
  15. config_h.set10('LOTTIE_IMAGE_MODULE_SUPPORT', true)
  16. endif
  17. if get_option('cache') == true
  18. config_h.set10('LOTTIE_CACHE_SUPPORT', true)
  19. endif
  20. if get_option('log') == true
  21. config_h.set10('LOTTIE_LOGGING_SUPPORT', true)
  22. endif
  23. if get_option('dumptree') == true
  24. config_h.set10('LOTTIE_LOGGING_SUPPORT', true)
  25. config_h.set10('LOTTIE_DUMP_TREE_SUPPORT', true)
  26. endif
  27. configure_file(
  28. output: 'config.h',
  29. configuration: config_h
  30. )
  31. subdir('inc')
  32. subdir('src')
  33. if get_option('example') == true
  34. subdir('example')
  35. endif
  36. if get_option('test') == true
  37. subdir('test')
  38. endif
  39. if get_option('cmake') == true and host_machine.system() != 'windows'
  40. cmake_bin = find_program('cmake', required: false)
  41. if cmake_bin.found()
  42. cmake = import('cmake')
  43. cmake.write_basic_package_version_file(
  44. version: meson.project_version(),
  45. name: 'rlottie',
  46. )
  47. cmakeconf = configuration_data()
  48. cmakeconf.set('VERSION', meson.project_version())
  49. cmake.configure_package_config_file(
  50. input: meson.current_source_dir() + '/cmake/rlottieConfig.cmake.in',
  51. name: 'rlottie',
  52. configuration: cmakeconf,
  53. )
  54. endif
  55. endif
  56. summary = '''
  57. Summary:
  58. rlottie version : @0@
  59. Build type : @1@
  60. Thread Support : @2@
  61. Module Support : @3@
  62. Cache Support : @4@
  63. Example : @5@
  64. Test : @6@
  65. Prefix : @7@
  66. '''.format(
  67. meson.project_version(),
  68. get_option('buildtype'),
  69. get_option('thread'),
  70. get_option('module'),
  71. get_option('cache'),
  72. get_option('example'),
  73. get_option('test'),
  74. get_option('prefix'),
  75. )
  76. message(summary)