-
Notifications
You must be signed in to change notification settings - Fork 42
/
AMBuilder
57 lines (45 loc) · 2.27 KB
/
AMBuilder
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
# vim: set sts=2 ts=8 sw=2 tw=99 et ft=python:
import os, sys
projectName = 'PTaH'
sourceFiles = [
'extension.cpp',
'forwards.cpp',
'natives.cpp',
'classes.cpp',
'smsdk_ext.cpp'
]
###############
# 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.sources += sourceFiles
binary = Extension.HL2Config(project, projectName + '.ext.' + Extension.sdk.ext, Extension.sdk)
compiler = binary.compiler
binary.sources += [
# Memory management via g_pMemAlloc
os.path.join(Extension.sdk.path, 'public', 'tier0', 'memoverride.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'),
os.path.join(Extension.sdk.path, 'public', 'engine', 'protobuf', 'netmessages.pb.cc'),
os.path.join(Extension.sdk.path, 'public', 'game', 'shared', 'csgo', 'protobuf', 'cstrike15_usermessages.pb.cc'),
os.path.join(Extension.sdk.path, 'public', 'game', 'shared', 'csgo', 'protobuf', 'cstrike15_usermessage_helpers.cpp'),
]
compiler.cxxincludes += [
os.path.join(Extension.sdk.path, 'common', 'protobuf-2.5.0', 'src'),
os.path.join(Extension.sdk.path, 'public', 'engine', 'protobuf'),
os.path.join(Extension.sdk.path, 'public', 'game', 'shared', 'csgo', 'protobuf'),
os.path.join(Extension.sdk.path, 'public', 'steam'),
os.path.join(Extension.sdk.path, 'game', 'server')
]
if builder.target_platform == 'linux':
lib_path = os.path.join(Extension.sdk.path, 'lib', 'linux32', 'release', 'libprotobuf.a')
elif builder.target_platform == 'windows':
lib_path = os.path.join(Extension.sdk.path, 'lib', 'win32', 'release', 'vs2017', 'libprotobuf.lib')
compiler.linkflags.insert(0, binary.Dep(lib_path))
Extension.extensions = builder.Add(project)