Skip to content

Commit

Permalink
Fix-up dhooks buildscript
Browse files Browse the repository at this point in the history
  • Loading branch information
Kenzzer committed Sep 10, 2024
1 parent ce432ee commit c7fbb54
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions extensions/dhooks/AMBuilder
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,12 @@ import os
for cxx in builder.targets:
binary = SM.ExtLibrary(builder, cxx, 'dhooks.ext')

# Only x86 on Linux and Windows is supported.
# mac isn't supported
if binary.compiler.target.platform == 'mac':
continue
# Presently only x86_64 on Windows is supported
if binary.compiler.target.arch == 'x86_64' and binary.compiler.target.platform != 'windows':
continue

binary.compiler.defines += [
'META_NO_HL2SDK',
Expand Down Expand Up @@ -69,12 +72,11 @@ for cxx in builder.targets:
binary.sources += [os.path.join('DynamicHooks', 'conventions', 'x86MsThiscall.cpp')]
else:
binary.sources += [os.path.join('DynamicHooks', 'conventions', 'x86GccThiscall.cpp')]

# Dynamic detour is only supported on x86
binary.compiler.defines += ['DHOOKS_DYNAMIC_DETOUR']

elif binary.compiler.target.arch == 'x86_64':
binary.compiler.defines += ['PLATFORM_X64']
binary.sources += ['../../sourcepawn/vm/x64/assembler-x64.cpp']
binary.compiler.cxxincludes += [
os.path.join(builder.sourcePath, 'public', 'jit', 'x64'),
os.path.join(builder.sourcePath, 'sourcepawn', 'vm', 'x64')
]

SM.extensions += [builder.Add(binary)]

0 comments on commit c7fbb54

Please sign in to comment.