-
Notifications
You must be signed in to change notification settings - Fork 2
/
AMBuilder
81 lines (69 loc) · 3.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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
# vim: set sts=2 ts=8 sw=2 tw=99 et ft=python:
import os
# Name of your extesion, this will also be it's file name.
projectName = 'actions'
# smsdk_ext.cpp will be automatically added later
sourceFiles = [
'source/sdk/shared/NextBotBehaviorShared.cpp',
'source/sdk/shared/NextBotComponentInterface.cpp',
'source/sdk/shared/NextBotInterface.cpp', 'source/actions_tools.cpp',
'source/actions_processor_shared.cpp', 'source/actions_processor_impl.cpp',
'source/actions_constructor_smc.cpp', 'source/actions_constructor.cpp',
'source/actions_custom_legacy.cpp', 'source/actions_component.cpp',
'source/actions_manager.cpp', 'source/actions_propagation.cpp',
'source/actions_pubvars.cpp', 'source/hook.cpp', 'source/extension.cpp',
'safetyhook/zydis/Zydis.c', 'safetyhook/src/allocator.cpp',
'safetyhook/src/easy.cpp', 'safetyhook/src/inline_hook.cpp',
'safetyhook/src/mid_hook.cpp', 'safetyhook/src/os.linux.cpp',
'safetyhook/src/os.windows.cpp', 'safetyhook/src/utility.cpp',
'safetyhook/src/vmt_hook.cpp',
os.path.join(Extension.sm_root, 'public', 'CDetour', 'detours.cpp')
]
project = builder.LibraryProject(projectName)
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]
if sdk['name'] in ['mock']:
continue
for cxx in builder.targets:
if not cxx.target.arch in sdk['platforms'][cxx.target.platform]:
continue
binary = Extension.HL2ExtConfig(
project, builder, cxx, projectName + '.ext.' + sdk['extension'],
sdk)
binary.compiler.cxxincludes += [
os.path.join(builder.sourcePath, 'safetyhook', 'include'),
os.path.join(builder.sourcePath, 'safetyhook'),
os.path.join(builder.sourcePath, 'source', 'sdk', 'shared'),
os.path.join(builder.sourcePath, 'source'),
os.path.join(builder.sourcePath, 'zydis')
]
binary.compiler.cxxincludes += [
os.path.join(builder.sourcePath, 'source', 'sdk', sdk_name),
os.path.join(builder.sourcePath, 'source', 'sdk', sdk_name,
'nextbot')
]
if binary.compiler.vendor == 'msvc':
binary.compiler.defines += ['_CRT_NO_VA_START_VALIDATION']
binary.compiler.cxxflags.append('/std:c++17')
binary.compiler.linkflags.append('legacy_stdio_definitions.lib')
elif binary.compiler.family == 'clang':
binary.compiler.cxxflags += [
'-Wno-reinterpret-base-class', '-Wno-infinite-recursion',
'-Wno-expansion-to-defined',
'-Wno-implicit-const-int-float-conversion', '-std=c++17',
'-Wno-register', '-Wno-varargs', '-fexceptions', '-Wno-delete-non-abstract-non-virtual-dtor'
]
binary.compiler.defines += [
'HAVE_STRING_H', '_GLIBCXX_USE_CXX11_ABI=0'
]
Extension.extensions += builder.Add(project)