-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy patharchBuild_SConscript
65 lines (50 loc) · 1.72 KB
/
archBuild_SConscript
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
# Based on the main NVDA helper SCons script
import os
import shutil
Import(
'env',
'binDir',
)
# We only support compiling with MSVC 14 (2015)
if not env.get('MSVC_VERSION','').startswith('14.'):
raise RuntimeError("Microsoft Visual C++ 14 not found")
TARGET_ARCH=env['TARGET_ARCH']
#Some defines and includes for the environment
env.Append(CPPDEFINES=['UNICODE','_UNICODE','_CRT_SECURE_NO_DEPRECATE'])
env.Append(CCFLAGS=['/W3','/WX']);
env.Append(CXXFLAGS=['/EHsc'])
env.Append(LINKFLAGS=['/incremental:no','/WX'])
env.Append(LINKFLAGS='/release') #We always want a checksum in the header
env.Append(MIDLFLAGS='/x64' if TARGET_ARCH=='x86_64' else '/win32')
env.Append(CCFLAGS='/O2')
env.Append(CCFLAGS='/GL')
env.Append(LINKFLAGS=['/LTCG'])
env.Append(CCFLAGS=['/MT'])
env.Append(CPPDEFINES=['NDEBUG'])
#We always want debug symbols
env.Append(PDB='${TARGET}.pdb')
env.Append(LINKFLAGS='/OPT:REF') #having symbols usually turns this off but we have no need for unused symbols
Export('env')
minHookLib=env.SConscript('minhook/SConscript')
Export('minHookLib')
inprocLib=env.SConscript('inproc/SConscript')
Export('inprocLib')
inprocDll=inprocLib[0]
Export('inprocDll')
env.Install(binDir,inprocDll)
loaderProgram=env.SConscript('loader/SConscript')
Export('loaderProgram')
loaderExe=loaderProgram[0]
Export('loaderExe')
env.Install(binDir,loaderExe)
masterLib=env.SConscript('master/SConscript')
Export('masterLib')
masterDll=masterLib[0]
Export('masterDll')
env.Install(binDir,masterDll)
clientLib=env.SConscript('client/SConscript')
Export('clientLib')
clientDll=clientLib[0]
Export('clientDll')
env.Install(binDir,clientDll)
Return('inprocDll loaderExe masterDll clientDll')