-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathAMBuilder
More file actions
65 lines (52 loc) · 2.45 KB
/
AMBuilder
File metadata and controls
65 lines (52 loc) · 2.45 KB
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
# vim: set sts=2 ts=8 sw=2 tw=99 et ft=python:
import os, sys
projectName = 'nextbot'
# smsdk_ext.cpp will be automatically added later
sourceFiles = [
'extension.cpp',
os.path.join(Extension.sm_root, 'public', 'CDetour', 'detours.cpp'),
os.path.join(Extension.sm_root, 'public', 'asm', 'asm.c'),
os.path.join(Extension.sm_root, 'public', 'libudis86/decode.c'),
os.path.join(Extension.sm_root, 'public', 'libudis86/itab.c'),
os.path.join(Extension.sm_root, 'public', 'libudis86/syn-att.c'),
os.path.join(Extension.sm_root, 'public', 'libudis86/syn-intel.c'),
os.path.join(Extension.sm_root, 'public', 'libudis86/syn.c'),
os.path.join(Extension.sm_root, 'public', 'libudis86/udis86.c'),
]
###############
# Make sure to edit PackageScript, which copies your files to their appropriate locations
# Simple extensions do not need to modify past this point.
project = Extension.HL2Project(builder, projectName + '.ext')
project.compiler.cxxincludes += [Extension.sm_root]
damagerulespath = os.path.join(builder.currentSourcePath, '../damagerules')
if not os.path.exists(damagerulespath):
if 'DAMAGERULESSRC' in os.environ:
damagerulespath = os.environ['DAMAGERULESSRC']
if os.path.exists(damagerulespath):
project.compiler.defines += ['__HAS_DAMAGERULES']
project.compiler.cxxincludes += [damagerulespath,os.path.join(damagerulespath,'public')]
animhelperspath = os.path.join(builder.currentSourcePath, '../animhelpers')
if not os.path.exists(animhelperspath):
if 'ANIMHELPERSSRC' in os.environ:
animhelperspath = os.environ['ANIMHELPERSSRC']
if os.path.exists(animhelperspath):
project.compiler.defines += ['__HAS_ANIMHELPERS']
project.compiler.cxxincludes += [animhelperspath,os.path.join(animhelperspath,'public')]
if os.path.isfile(os.path.join(builder.currentSourcePath, 'sdk', 'smsdk_ext.cpp')):
# Use the copy included in the project
project.sources += [os.path.join('sdk', 'smsdk_ext.cpp')]
else:
# Use the copy included with SM 1.6 and newer
project.sources += [os.path.join(Extension.sm_root, 'public', 'smsdk_ext.cpp')]
project.sources += sourceFiles
for sdk_name in Extension.sdks:
sdk = Extension.sdks[sdk_name]
binary = Extension.HL2Config(project, projectName + '.ext.' + sdk.ext, sdk)
binary.compiler.cxxincludes += [
sdk.path,
os.path.join(sdk.path, 'game'),
os.path.join(sdk.path, 'public'),
os.path.join(sdk.path, 'game/server'),
os.path.join(sdk.path, 'game/shared'),
]
Extension.extensions = builder.Add(project)