File tree Expand file tree Collapse file tree 1 file changed +15
-4
lines changed Expand file tree Collapse file tree 1 file changed +15
-4
lines changed Original file line number Diff line number Diff line change 11project (' dcontainers' , ' d' ,
2- meson_version : ' >=0.44 ' ,
2+ meson_version : ' >=0.52 ' ,
33 license : ' BSL-1.0' ,
44 version : ' 0.8.0'
55)
@@ -30,6 +30,7 @@ dcontainers_src = [
3030 ' src/containers/unrolledlist.d'
3131]
3232
33+ dc = meson .get_compiler(' d' )
3334src_dir = include_directories (' src/' )
3435
3536#
@@ -58,15 +59,25 @@ dcontainers_dep = declare_dependency(
5859#
5960# Tests
6061#
61- extra_args = [' -main' ]
62+ if dc.get_id() == ' gcc'
63+ test_link_args = []
64+ test_main_file = configure_file (capture : true ,
65+ command : [' echo' , ' int main(string[] args) { return 0; }' ],
66+ output : ' unittest_main.d'
67+ )
68+ else
69+ test_link_args = [' -main' ]
70+ test_main_file = []
71+ endif
6272
6373dcontainers_test_exe = executable (' test_dcontainers' ,
6474 [dcontainers_src,
6575 ' test/compile_test.d' ,
66- ' test/external_allocator_test.d' ],
76+ ' test/external_allocator_test.d' ,
77+ test_main_file],
6778 include_directories : [src_dir],
6879 d_unittest : true ,
69- link_args : extra_args
80+ link_args : test_link_args
7081)
7182test (' test_dcontainers' , dcontainers_test_exe)
7283
You can’t perform that action at this time.
0 commit comments