5 # Copyright The SCons Foundation
7 # Permission is hereby granted, free of charge, to any person obtaining
8 # a copy of this software and associated documentation files (the
9 # "Software"), to deal in the Software without restriction, including
10 # without limitation the rights to use, copy, modify, merge, publish,
11 # distribute, sublicense, and/or sell copies of the Software, and to
12 # permit persons to whom the Software is furnished to do so, subject to
13 # the following conditions:
15 # The above copyright notice and this permission notice shall be included
16 # in all copies or substantial portions of the Software.
18 # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
19 # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
20 # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
21 # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
22 # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
23 # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
24 # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
27 Verify that manifest files get embedded correctly in EXEs and DLLs
36 test
= TestSCons
.TestSCons()
38 test
.skip_if_not_msvc()
40 test
.write('SConstruct', """\
41 DefaultEnvironment(tools=[])
42 env = Environment(WINDOWS_EMBED_MANIFEST=True)
43 env.Append(CCFLAGS='/MD')
44 env.Append(LINKFLAGS='/MANIFEST')
45 env.Append(SHLINKFLAGS='/MANIFEST')
46 exe = env.Program('test.cpp')
47 dll = env.SharedLibrary('testdll.cpp')
49 'exe-extracted.manifest',
51 '$MT /nologo -inputresource:${SOURCE};1 -out:${TARGET}',
54 'dll-extracted.manifest',
56 '$MT /nologo -inputresource:${SOURCE};2 -out:${TARGET}',
58 env2 = Environment(WINDOWS_EMBED_MANIFEST=True) # no /MD here
59 env2.Program('test-nomanifest', env2.Object('test-nomanifest', 'test.cpp'))
62 test
.write('test.cpp', """\
66 main(int argc, char *argv)
68 printf("test.cpp\\n");
73 test
.write('testdll.cpp', """\
77 __declspec(dllexport) int
78 testdll(int argc, char *argv)
80 printf("testdll.cpp\\n");
85 test
.run(arguments
='.')
87 test
.must_exist('test%s' % _exe
)
88 test
.must_exist('test%s.manifest' % _exe
)
89 test
.must_contain('exe-extracted.manifest', '</assembly>', mode
='r')
90 test
.must_exist('testdll%s' % _dll
)
91 test
.must_exist('testdll%s.manifest' % _dll
)
92 test
.must_contain('dll-extracted.manifest', '</assembly>', mode
='r')
98 # indent-tabs-mode:nil
100 # vim: set expandtab tabstop=4 shiftwidth=4: