Merge pull request #3715 from jon-turney/duplicate-rsrc-script-name
Use a unique name for windows resource compilation custom targetpull/3208/merge
commit
8014a42f57
10 changed files with 55 additions and 2 deletions
@ -0,0 +1 @@ |
|||||||
|
a = win.compile_resources('rsrc.rc') |
@ -0,0 +1 @@ |
|||||||
|
a RCDATA { "a" } |
@ -0,0 +1,2 @@ |
|||||||
|
bf = files('rsrc.rc') |
||||||
|
b = win.compile_resources(bf) |
@ -0,0 +1 @@ |
|||||||
|
b RCDATA { "b" } |
@ -0,0 +1,2 @@ |
|||||||
|
cf = files('rsrc.rc') |
||||||
|
c = win.compile_resources(cf) |
@ -0,0 +1 @@ |
|||||||
|
c RCDATA { "c" } |
@ -0,0 +1,19 @@ |
|||||||
|
project('foobar', 'c') |
||||||
|
|
||||||
|
win = import('windows') |
||||||
|
|
||||||
|
subdir('a') |
||||||
|
subdir('b') |
||||||
|
subdir('c') |
||||||
|
|
||||||
|
main = win.compile_resources('rsrc.rc') |
||||||
|
|
||||||
|
testa = executable('testa', 'verify.c', a) |
||||||
|
testb = executable('testb', 'verify.c', b) |
||||||
|
testc = executable('testc', 'verify.c', c) |
||||||
|
testmain = executable('testmain', 'verify.c', main) |
||||||
|
|
||||||
|
test('a', testa, args: 'a') |
||||||
|
test('b', testb, args: 'b') |
||||||
|
test('c', testc, args: 'c') |
||||||
|
test('main', testmain, args: 'main') |
@ -0,0 +1 @@ |
|||||||
|
main RCDATA { "main" } |
@ -0,0 +1,23 @@ |
|||||||
|
#include <assert.h> |
||||||
|
#include <windows.h> |
||||||
|
|
||||||
|
int main(int arc, char *argv[]) |
||||||
|
{ |
||||||
|
// verify that the expected resource exists and has the expected contents
|
||||||
|
HRSRC hRsrc; |
||||||
|
unsigned int size; |
||||||
|
HGLOBAL hGlobal; |
||||||
|
void* data; |
||||||
|
|
||||||
|
hRsrc = FindResource(NULL, argv[1], RT_RCDATA); |
||||||
|
assert(hRsrc); |
||||||
|
|
||||||
|
size = SizeofResource(NULL, hRsrc); |
||||||
|
hGlobal = LoadResource(NULL, hRsrc); |
||||||
|
data = LockResource(hGlobal); |
||||||
|
|
||||||
|
assert(size == strlen(argv[1])); |
||||||
|
assert(memcmp(data, argv[1], size) == 0); |
||||||
|
|
||||||
|
return 0; |
||||||
|
} |
Loading…
Reference in new issue