meson.patch 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. diff --git a/meson.build b/meson.build
  2. index 5cf334b..ad9f5cd 100644
  3. --- a/meson.build
  4. +++ b/meson.build
  5. @@ -291,6 +291,8 @@ install_headers(meson.current_build_dir() / 'version.h', subdir: 'mcfgthread')
  6. #===========================================================
  7. # Rules for 'lib/libmcfgthread'
  8. #===========================================================
  9. +if get_option('default_library') == 'shared'
  10. +
  11. mcfgthread_version_o = import('windows').compile_resources(
  12. 'mcfgthread/version.rc',
  13. args: [ '-I.', '-c65001' ],
  14. @@ -320,22 +322,25 @@ lib_mcfgthread_dll = shared_library('mcfgthread',
  15. version: '.'.join([ ver.get('abi_major'), ver.get('abi_minor'), '0' ]),
  16. install: true)
  17. -lib_mcfgthread_a = static_library('mcfgthread',
  18. - c_pch: 'mcfgthread/xprecompiled.h',
  19. - c_args: [ '-ffreestanding', '-fasynchronous-unwind-tables' ],
  20. - sources: [ mcfgthread_src_min, mcfgthread_src_ex, ],
  21. - dependencies: [ dep_kernel32, dep_ntdll ],
  22. - install: true)
  23. -
  24. import('pkgconfig').generate(lib_mcfgthread_dll,
  25. name: 'mcfgthread',
  26. url: 'https://github.com/lhmouse/mcfgthread',
  27. description: 'Cornerstone library for C++11 threading on mingw-w64',
  28. libraries: '-lntdll')
  29. +elif get_option('default_library') == 'static'
  30. +
  31. +lib_mcfgthread_a = static_library('mcfgthread',
  32. + c_pch: 'mcfgthread/xprecompiled.h',
  33. + c_args: [ '-ffreestanding', '-fasynchronous-unwind-tables' ],
  34. + sources: [ mcfgthread_src_min, mcfgthread_src_ex, ],
  35. + dependencies: [ dep_kernel32, dep_ntdll ],
  36. + install: true)
  37. +endif
  38. #===========================================================
  39. # Rules for tests
  40. #===========================================================
  41. +if get_option('build-test')
  42. foreach src: test_src
  43. test_c_args = []
  44. test_cpp_args = []
  45. @@ -377,3 +382,4 @@ foreach src: test_src
  46. test('..' / src, test_exe)
  47. endforeach
  48. +endif
  49. \ No newline at end of file
  50. diff --git a/meson.options b/meson.options
  51. index d0342f8..b45d572 100644
  52. --- a/meson.options
  53. +++ b/meson.options
  54. @@ -15,3 +15,7 @@
  55. option('enable-debug-checks',
  56. type: 'boolean', value: false,
  57. description: 'enable run-time assertions')
  58. +
  59. +option('build-test',
  60. + type: 'boolean', value: false,
  61. + description: 'Build unit test')