File: SConscript

package info (click to toggle)
nsis 3.04-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 12,076 kB
  • sloc: cpp: 36,735; ansic: 26,691; python: 1,282; asm: 712; xml: 511; pascal: 215; makefile: 205
file content (79 lines) | stat: -rwxr-xr-x 1,458 bytes parent folder | download | duplicates (3)
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
target = 'System'

files = Split("""
	Source/Buffers.c
	Source/Plugin.c
	Source/System.c
""")

libs = Split("""
	kernel32
	user32
	ole32
""")

examples = Split("""
	Resource.dll
	System.nsi
	System.nsh
	SysFunc.nsh
""")

docs = Split("""
	System.html
	WhatsNew.txt
""")

Import('BuildPlugin env')

defs = ['SYSTEM_EXPORTS']
msvc = 'msvc' in env['TOOLS'] or 'mstoolkit' in env['TOOLS']

srcsuff = ''
if env['TARGET_ARCH'] != 'x86':
	srcsuff = '-' + env['TARGET_ARCH']
	defs += ['SYSTEM_NOCALLBACKS'] # BUGBUG: Remove this when CallBack() is implemented
filename = 'Call' + srcsuff

src_ascpp = """
	#if 0 /* a C style comment */
	ERROR: assembler-with-cpp required!
	#else
	.end
	#endif
"""
conf = env.Configure()
if conf.TryCompile('END', '.S'):
	files += ['Source/'+filename+'.S']
elif (not msvc) and conf.TryCompile(src_ascpp, '.S'):
	files += ['Source/'+filename+'CPP.S']
elif (not msvc) and conf.TryCompile(src_ascpp, '.sx'):
	files += ['Source/'+filename+'CPP.sx']
else:
	print('WARNING: System.dll: unable to find assembler for '+filename+'.S')
conf.Finish()

BuildPlugin(
	target,
	files,
	libs,
	examples,
	docs,
	nodeflib = False,
	defines = defs
)

res = 'Resource/Resource.rc'
res_obj = 'Resource/Resource-rc.o'
res_target = env.RES(res_obj, res)

res_main = env.Object('Resource/Main.c')

resources = Split("""
	Resource/Icon.ico
	Resource/Resource.h
""")

env.Depends(res_target, resources)

env.SharedLibrary('Resource', res_target + res_main)