-
Notifications
You must be signed in to change notification settings - Fork 6
/
icl-win32.scons
55 lines (41 loc) · 1.57 KB
/
icl-win32.scons
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
import os
import re
Import('env')
env.Append(CPPFLAGS='-DWIN32 /EHs ')
if env['debug']:
env.Append(CPPFLAGS='/Wall ')
if env['optimized']:
env.Append(CPPFLAGS='/fast /Wall -DNDEBUG /Qansi-alias /Qalias-const /Qalias-args /fp:fast -D_CRT_SECURE_NO_DEPRECATE ')
if env['profile']:
env.Append(CPPFLAGS='/Ox /Zi /MD -DNDEBUG -DWIN32 ')
env.Append(LINKFLAGS='/DEBUG /Profile')
elif env['optimized']:
env.Append(CPPFLAGS='/Ox /MD -DNDEBUG -DWIN32 ')
elif env['debug']:
env.Append(CPPFLAGS='/GS /Wall /Zi /MDd -DWIN32 ')
env.Append(LINKFLAGS='/DEBUG')
env.Append(LIBPATH=os.environ['PATH'].split(';'))
if 'INCLUDE' in os.environ:
env.Append(CPPPATH=os.environ['INCLUDE'].split(';'))
env['boost'] = 'iw'
env['SWIG'] = r'c:\swig\swig.exe'
Export('env')
env = SConscript('boost-win32.scons')
if env['topdir'] != '':
env.Tool('icl', topdir = env['topdir'])
else:
env.Tool('icl')
# Override the original SharedLibrary so that the manifest is embedded in the DLL
def MSVCSharedLibrary(env, library, sources, **args):
cat=env.OriginalSharedLibrary(library, sources, **args)
env.AddPostAction(cat, 'mt.exe -nologo -manifest ${TARGET}.manifest -outputresource:$TARGET;2')
return cat
env['BUILDERS']['OriginalSharedLibrary'] = env['BUILDERS']['SharedLibrary']
env['BUILDERS']['SharedLibrary'] = MSVCSharedLibrary
env['SWIGCFILESUFFIX'] = '_wrap.msvc$CFILESUFFIX'
env['SWIGCXXFILESUFFIX'] = '_wrap.msvc$CXXFILESUFFIX'
env['SWIGCFILESUFFIX'] = '_wrap.icl$CFILESUFFIX'
env['SWIGCXXFILESUFFIX'] = '_wrap.icl$CXXFILESUFFIX'
Export('env')
env = SConscript('common.scons')
Return('env')