-
Notifications
You must be signed in to change notification settings - Fork 2
/
AMBuilder
50 lines (42 loc) · 2.54 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
# 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_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)
binary.sources += [
'accelerator_local.cpp',
os.path.join('breakpad', 'src', 'src', 'common', 'dwarf_cfi_to_module.cc'),
os.path.join('breakpad', 'src', 'src', 'common', 'dwarf_cu_to_module.cc'),
os.path.join('breakpad', 'src', 'src', 'common', 'dwarf_line_to_module.cc'),
os.path.join('breakpad', 'src', 'src', 'common', 'dwarf_range_list_handler.cc'),
os.path.join('breakpad', 'src', 'src', 'common', 'language.cc'),
os.path.join('breakpad', 'src', 'src', 'common', 'module.cc'),
os.path.join('breakpad', 'src', 'src', 'common', 'path_helper.cc'),
os.path.join('breakpad', 'src', 'src', 'common', 'stabs_reader.cc'),
os.path.join('breakpad', 'src', 'src', 'common', 'stabs_to_module.cc'),
os.path.join('breakpad', 'src', 'src', 'common', 'dwarf', 'bytereader.cc'),
os.path.join('breakpad', 'src', 'src', 'common', 'dwarf', 'dwarf2diehandler.cc'),
os.path.join('breakpad', 'src', 'src', 'common', 'dwarf', 'dwarf2reader.cc'),
os.path.join('breakpad', 'src', 'src', 'common', 'dwarf', 'elf_reader.cc'),
os.path.join('breakpad', 'src', 'src', 'common', 'linux', 'crc32.cc'),
os.path.join('breakpad', 'src', 'src', 'common', 'linux', 'dump_symbols.cc'),
os.path.join('breakpad', 'src', 'src', 'common', 'linux', 'elf_symbols_to_module.cc')
]
if sdk_name in ['dota', 'cs2']:
binary.sources += [
os.path.join(sdk.path, 'public', 'tier0', 'memoverride.cpp')
]
# Export only CreateInterface
if binary.compiler.target.platform == 'linux':
binary.compiler.linkflags += ['-Wl,--version-script=' + os.path.join(builder.currentSourcePath, 'ExportMap')]
nodes = builder.Add(binary)
MMSPlugin.binaries += [nodes]
break