patch-meson_build 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. --- systemd-236.orig/meson.build 2017-12-14 23:09:57.000000000 +0100
  2. +++ systemd-236/meson.build 2018-01-01 21:03:50.570757021 +0100
  3. @@ -260,10 +260,12 @@ cc = meson.get_compiler('c')
  4. pkgconfig = import('pkgconfig')
  5. check_compilation_sh = find_program('tools/meson-check-compilation.sh')
  6. -cxx = find_program('c++', required : false)
  7. -if cxx.found()
  8. - # Used only for tests
  9. - add_languages('cpp')
  10. +if get_option('tests') != 'false'
  11. + cxx = find_program('c++', required : false)
  12. + if cxx.found()
  13. + # Used only for tests
  14. + add_languages('cpp')
  15. + endif
  16. endif
  17. foreach arg : ['-Wextra',
  18. @@ -2388,48 +2390,51 @@ executable('systemd-sulogin-shell',
  19. install_dir : rootlibexecdir)
  20. ############################################################
  21. +if want_tests == 'false'
  22. + message('Not compiling because tests is set to false')
  23. +else
  24. + foreach tuple : tests
  25. + sources = tuple[0]
  26. + link_with = tuple[1].length() > 0 ? tuple[1] : [libshared]
  27. + dependencies = tuple[2]
  28. + condition = tuple.length() >= 4 ? tuple[3] : ''
  29. + type = tuple.length() >= 5 ? tuple[4] : ''
  30. + defs = tuple.length() >= 6 ? tuple[5] : []
  31. + incs = tuple.length() >= 7 ? tuple[6] : includes
  32. + timeout = 30
  33. -foreach tuple : tests
  34. - sources = tuple[0]
  35. - link_with = tuple[1].length() > 0 ? tuple[1] : [libshared]
  36. - dependencies = tuple[2]
  37. - condition = tuple.length() >= 4 ? tuple[3] : ''
  38. - type = tuple.length() >= 5 ? tuple[4] : ''
  39. - defs = tuple.length() >= 6 ? tuple[5] : []
  40. - incs = tuple.length() >= 7 ? tuple[6] : includes
  41. - timeout = 30
  42. -
  43. - name = sources[0].split('/')[-1].split('.')[0]
  44. - if type.startswith('timeout=')
  45. - timeout = type.split('=')[1].to_int()
  46. - type = ''
  47. - endif
  48. + name = sources[0].split('/')[-1].split('.')[0]
  49. + if type.startswith('timeout=')
  50. + timeout = type.split('=')[1].to_int()
  51. + type = ''
  52. + endif
  53. - if condition == '' or conf.get(condition) == 1
  54. - exe = executable(
  55. - name,
  56. - sources,
  57. - include_directories : incs,
  58. - link_with : link_with,
  59. - dependencies : dependencies,
  60. - c_args : defs,
  61. - install_rpath : rootlibexecdir,
  62. - install : install_tests,
  63. - install_dir : join_paths(testsdir, type))
  64. + if condition == '' or conf.get(condition) == 1
  65. + exe = executable(
  66. + name,
  67. + sources,
  68. + include_directories : incs,
  69. + link_with : link_with,
  70. + dependencies : dependencies,
  71. + c_args : defs,
  72. + install_rpath : rootlibexecdir,
  73. + install : install_tests,
  74. + install_dir : join_paths(testsdir, type))
  75. - if type == 'manual'
  76. - message('@0@ is a manual test'.format(name))
  77. - elif type == 'unsafe' and want_tests != 'unsafe'
  78. - message('@0@ is an unsafe test'.format(name))
  79. + if type == 'manual'
  80. + message('@0@ is a manual test'.format(name))
  81. + elif type == 'unsafe' and want_tests != 'unsafe'
  82. + message('@0@ is an unsafe test'.format(name))
  83. + else
  84. + test(name, exe,
  85. + env : test_env,
  86. + timeout : timeout)
  87. + endif
  88. else
  89. - test(name, exe,
  90. - env : test_env,
  91. - timeout : timeout)
  92. + message('Not compiling @0@ because @1@ is not true'.format(name, condition))
  93. endif
  94. - else
  95. - message('Not compiling @0@ because @1@ is not true'.format(name, condition))
  96. - endif
  97. -endforeach
  98. + endforeach
  99. +endif
  100. test_libsystemd_sym = executable(
  101. 'test-libsystemd-sym',