diff options
| author | Andrei Alexeyev <0x416b617269@gmail.com> | 2017-12-22 20:16:56 +0200 |
|---|---|---|
| committer | Andrei Alexeyev <0x416b617269@gmail.com> | 2018-01-12 23:36:48 +0200 |
| commit | f8bd1c5ff26bbb6b88dedcb400a33841201bf4eb (patch) | |
| tree | 3f9193278b3d6fc20adadee4fa14a282e37a5638 /test cases/windows | |
| parent | ef7cb9f280175d026b16e8e02ecda9ec87d7fd6d (diff) | |
| download | meson-f8bd1c5ff26bbb6b88dedcb400a33841201bf4eb.tar.gz | |
windows.compile_resources: fix compiling multiple resources within one project
Diffstat (limited to 'test cases/windows')
6 files changed, 24 insertions, 18 deletions
diff --git a/test cases/windows/13 resources with custom targets/inc/meson.build b/test cases/windows/13 resources with custom targets/inc/meson.build deleted file mode 100644 index b8b511a98..000000000 --- a/test cases/windows/13 resources with custom targets/inc/meson.build +++ /dev/null @@ -1 +0,0 @@ -inc = include_directories('resource') diff --git a/test cases/windows/13 resources with custom targets/inc/resource/resource.h b/test cases/windows/13 resources with custom targets/inc/resource/resource.h deleted file mode 100644 index dbdd5094d..000000000 --- a/test cases/windows/13 resources with custom targets/inc/resource/resource.h +++ /dev/null @@ -1 +0,0 @@ -#define ICON_ID 1 diff --git a/test cases/windows/13 resources with custom targets/meson.build b/test cases/windows/13 resources with custom targets/meson.build index ddb7d6e8a..b1e2b091b 100644 --- a/test cases/windows/13 resources with custom targets/meson.build +++ b/test cases/windows/13 resources with custom targets/meson.build @@ -59,11 +59,12 @@ if meson.get_compiler('c').get_id() == 'gcc' and host_machine.system() == 'windo # We hope you never have to implement something like this. endif -subdir('inc') subdir('res') -exe = executable('prog', 'prog.c', - res, - gui_app : true) +foreach id : [0, 1, 2] + exe = executable('prog_@0@'.format(id), 'prog.c', + res[id], + gui_app : true) -test('winmain', exe) + test('winmain_@0@'.format(id), exe) +endforeach diff --git a/test cases/windows/13 resources with custom targets/res/meson.build b/test cases/windows/13 resources with custom targets/res/meson.build index 266e3800e..c15bd92d2 100644 --- a/test cases/windows/13 resources with custom targets/res/meson.build +++ b/test cases/windows/13 resources with custom targets/res/meson.build @@ -2,12 +2,17 @@ win = import('windows') rc_writer = find_program('./gen-res.py') -rc_target = custom_target('RC source file', - input : 'myres.rc.in', - output : 'myres.rc', - command : [rc_writer, '@INPUT@', '@OUTPUT@', files('sample.ico')], - install : false, - build_always : true) - -res = win.compile_resources(rc_target, - include_directories : inc) +rc_sources = [] + +foreach id : [1, 2] + rc_sources += custom_target('RC source file @0@'.format(id), + input : 'myres.rc.in', + output : 'myres_@0@.rc'.format(id), + command : [rc_writer, '@INPUT@', '@OUTPUT@', files('sample.ico')], + install : false, + build_always : true) +endforeach + +rc_sources += files('myres_static.rc') + +res = win.compile_resources(rc_sources) diff --git a/test cases/windows/13 resources with custom targets/res/myres.rc.in b/test cases/windows/13 resources with custom targets/res/myres.rc.in index 9bb045dbe..6899bc8f3 100644 --- a/test cases/windows/13 resources with custom targets/res/myres.rc.in +++ b/test cases/windows/13 resources with custom targets/res/myres.rc.in @@ -1,4 +1,3 @@ #include<windows.h> -#include"resource.h" -ICON_ID ICON "{icon}" +1 ICON "{icon}" diff --git a/test cases/windows/13 resources with custom targets/res/myres_static.rc b/test cases/windows/13 resources with custom targets/res/myres_static.rc new file mode 100644 index 000000000..12838aee2 --- /dev/null +++ b/test cases/windows/13 resources with custom targets/res/myres_static.rc @@ -0,0 +1,3 @@ +#include<windows.h> + +1 ICON "sample.ico" |
