-
Notifications
You must be signed in to change notification settings - Fork 1
/
AMBuilder
58 lines (50 loc) · 2.65 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
58
# vim: set sts=2 ts=8 sw=2 tw=99 et ft=python:
import os
# Here only one sdk should be available to generate only one executable in the end,
# as multi-sdk loading isn't supported out of the box by metamod, and would require specifying the full path in the vdf
# which in the end would ruin the multi-platform (unix, win etc) loading by metamod as it won't be able to append platform specific extension
# so just fall back to the single binary.
# Multi-sdk solutions should be manually loaded with a custom plugin loader (examples being sourcemod, stripper:source)
for sdk_target in MMSPlugin.sdk_targets:
sdk = sdk_target.sdk
cxx = sdk_target.cxx
binary = MMSPlugin.HL2Library(builder, cxx, MMSPlugin.plugin_name, sdk)
binary.sources += [
'fakeranks.cpp',
'cs2_sdk/schema.cpp',
os.path.join(sdk['path'], 'tier1', 'generichash.cpp'),
os.path.join(sdk['path'], 'entity2', 'entitysystem.cpp'),
os.path.join(sdk['path'], 'entity2', 'entityidentity.cpp'),
os.path.join(sdk['path'], 'entity2', 'entitykeyvalues.cpp'),
os.path.join(sdk['path'], 'tier1', 'keyvalues3.cpp'),
'protobuf/generated/usermessages.pb.cc',
'protobuf/generated/cstrike15_usermessages.pb.cc',
'protobuf/generated/cstrike15_gcmessages.pb.cc',
'protobuf/generated/steammessages.pb.cc',
'protobuf/generated/engine_gcmessages.pb.cc',
'protobuf/generated/gcsdk_gcmessages.pb.cc',
'protobuf/generated/networkbasetypes.pb.cc',
'protobuf/generated/network_connection.pb.cc'
]
binary.compiler.cxxincludes += [
os.path.join(builder.sourcePath, 'vendor', 'funchook', 'include'),
]
target_folder = 'Debug' if builder.options.debug else 'Release'
if binary.compiler.target.platform == 'linux':
binary.compiler.postlink += [
os.path.join(builder.sourcePath, 'vendor', 'funchook', 'lib', target_folder, 'libfunchook.a'),
os.path.join(builder.sourcePath, 'vendor', 'funchook', 'lib', target_folder, 'libdistorm.a'),
os.path.join(builder.sourcePath, 'vendor', 'protobuf', 'linux', 'libprotobuf.a'),
]
binary.sources += ['utils/plat_unix.cpp']
elif binary.compiler.target.platform == 'windows':
binary.compiler.postlink += [
os.path.join('psapi.lib'),
os.path.join(builder.sourcePath, 'vendor', 'funchook', 'lib', target_folder, 'funchook.lib'),
os.path.join(builder.sourcePath, 'vendor', 'funchook', 'lib', target_folder, 'distorm.lib'),
os.path.join(builder.sourcePath, 'vendor', 'protobuf', 'windows', 'libprotobuf.lib'),
os.path.join(sdk['path'], 'lib', 'public', 'win64', 'steam_api64.lib')
]
binary.sources += ['utils/plat_win.cpp']
nodes = builder.Add(binary)
MMSPlugin.binaries += [nodes]