This repository has been archived by the owner on Nov 15, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathAMBuilder
69 lines (57 loc) · 2.45 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
59
60
61
62
63
64
65
66
67
68
69
# vim: set sts=2 ts=8 sw=2 tw=99 et ft=python:
import os
MMSPlugin.plugin_name = 'resourcemod'
for sdk_name in MMSPlugin.sdks:
for cxx in MMSPlugin.all_targets:
sdk = MMSPlugin.sdks[sdk_name]
if not cxx.target.arch in sdk.platformSpec[cxx.target.platform]:
continue
binary = MMSPlugin.HL2Library(builder, cxx, MMSPlugin.plugin_name, sdk)
if binary.compiler.family == 'gcc' or binary.compiler.family == 'clang':
binary.compiler.cxxflags += ['--std=c++17']
elif binary.compiler.family == 'msvc':
binary.compiler.cxxflags += ['/std:c++20']
binary.compiler.cxxincludes += [
os.path.join(builder.sourcePath, 'third_party', 'google', 'protobuf', 'third_party', 'abseil-cpp'),
os.path.join(builder.sourcePath, 'third_party', 'google', 'protobuf', 'src'),
os.path.join(builder.sourcePath, 'protobuf', 'generated'),
os.path.join(builder.sourcePath, 'third_party'),
os.path.join(builder.sourcePath, 'third_party', 'metacall'),
]
target_protobuf = 'libprotobufd' if builder.options.debug else 'libprotobuf'
if binary.compiler.target.platform == 'linux':
binary.compiler.postlink += [
]
binary.sources += ['game/cs2/plat_unix.cpp']
elif binary.compiler.target.platform == 'windows':
binary.compiler.postlink += [
os.path.join(builder.sourcePath, 'lib', 'metacall.lib')
]
binary.sources += ['game/cs2/plat_win.cpp']
if binary.compiler.family == 'clang':
binary.compiler.cxxflags += ['-Wno-register']
binary.sources += [
'game/ResourceMod.cpp',
'game/GameDLL.cpp',
'game/hooks/EventManager.cpp',
'engine/Engine.cpp',
'engine/Utils.cpp',
'game/cs2/Schema.cpp',
'game/hooks/LegacyEvents.cpp',
'game/GameSystem.cpp'
]
if sdk_name in ['dota', 'cs2']:
binary.sources += [
os.path.join(sdk.path, 'entity2', 'entitysystem.cpp'),
os.path.join(sdk.path, 'entity2', 'entityidentity.cpp'),
os.path.join(sdk.path, 'tier1', 'convar.cpp')
]
if sdk_name in ['dota', 'cs2'] and (binary.compiler.target.platform == 'windows' and builder.options.debug != '1') or binary.compiler.target.platform == 'linux':
binary.sources += [
os.path.join(sdk.path, 'public', 'tier0', 'memoverride.cpp')
]
if cxx.target.arch == 'x86':
binary.sources += ['sourcehook/sourcehook_hookmangen.cpp']
nodes = builder.Add(binary)
MMSPlugin.binaries += [nodes]
break