-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathAMBuildScript
More file actions
37 lines (33 loc) · 971 Bytes
/
AMBuildScript
File metadata and controls
37 lines (33 loc) · 971 Bytes
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
class KHook(object):
def __init__(self):
self.all_targets = []
self.libsafetyhook = {}
self.libkhook = {}
def configure(self):
target_archs = []
if builder.options.targets:
target_archs = builder.options.targets.split(',')
else:
target_archs = ['x86', 'x86_64']
for arch in target_archs:
try:
cxx = builder.DetectCxx(target_arch = arch)
except Exception as e:
if builder.options.targets:
raise
print('Skipping target {}: {}'.format(arch, e))
continue
self.all_targets.append(cxx)
for cxx in self.all_targets:
if cxx.like('gcc'):
cxx.cxxflags += [
'-std=c++17',
]
elif cxx.family == 'msvc':
cxx.cxxflags += [
'/std:c++17'
]
KH = KHook()
KH.configure()
builder.Build('third_party/safetyhook/AMBuilder', {'SafetyHook': KH})
builder.Build('AMBuilder', {'KHook': KH})