sourcemod/sourcepawn/jit/AMBuilder

90 lines
2.4 KiB
Plaintext
Raw Normal View History

# vim: set sts=2 ts=8 sw=2 tw=99 et ft=python:
2009-08-30 09:46:56 +02:00
import os
Includes = [
os.path.join(SM.mms_root, 'core', 'sourcehook'),
os.path.join(builder.sourcePath, 'sourcepawn', 'jit'),
os.path.join(builder.sourcePath, 'public'),
os.path.join(builder.sourcePath, 'public', 'sourcepawn'),
os.path.join(builder.sourcePath, 'public', 'amtl'),
os.path.join(builder.sourcePath, 'public', 'jit'),
os.path.join(builder.sourcePath, 'public', 'jit', 'x86'),
2014-08-22 07:16:07 +02:00
# The include path for SP v2 stuff.
os.path.join(builder.sourcePath, 'sourcepawn', 'include'),
]
2009-08-30 09:46:56 +02:00
def setup(binary):
compiler = binary.compiler
compiler.includes += Includes
if compiler.vendor == 'gcc' or compiler.vendor == 'clang':
compiler.cxxflags += ['-fno-rtti']
elif binary.compiler.vendor == 'msvc':
compiler.cxxflags += ['/GR-']
if binary.compiler.cc.behavior == 'msvc':
compiler.cxxflags.remove('/TP')
return binary
# Build the static library.
library = setup(builder.compiler.StaticLibrary('sourcepawn'))
library.sources += [
2015-02-24 07:36:10 +01:00
'api.cpp',
'code-allocator.cpp',
2015-02-24 10:12:23 +01:00
'code-stubs.cpp',
'plugin-context.cpp',
'plugin-runtime.cpp',
'compiled-function.cpp',
'debug-trace.cpp',
'environment.cpp',
'scripted-invoker.cpp',
'opcodes.cpp',
'interpreter.cpp',
'watchdog_timer.cpp',
2015-02-24 10:12:23 +01:00
'x86/code-stubs-x86.cpp',
'x86/jit_x86.cpp',
2015-02-24 10:12:23 +01:00
'x86/x86-utils.cpp',
'zlib/adler32.c',
'zlib/compress.c',
'zlib/crc32.c',
'zlib/deflate.c',
'zlib/gzio.c',
'zlib/infback.c',
'zlib/inffast.c',
'zlib/inflate.c',
'zlib/inftrees.c',
'zlib/trees.c',
'zlib/uncompr.c',
'zlib/zutil.c',
'md5/md5.cpp',
'../../public/jit/x86/assembler-x86.cpp',
]
libsourcepawn = builder.Add(library).binary
# Build the dynamically-linked library.
dll = setup(SM.Library(builder, 'sourcepawn.jit.x86'))
dll.compiler.linkflags[0:0] = [libsourcepawn]
dll.sources += [
'dll_exports.cpp'
]
if builder.target_platform == 'linux':
dll.compiler.postlink += ['-lpthread', '-lrt']
SM.binaries += [builder.Add(dll)]
# Build the debug shell.
shell = setup(SM.Program(builder, 'spshell'))
shell.compiler.defines += ['SPSHELL']
shell.compiler.linkflags[0:0] = [libsourcepawn]
shell.sources += [
'dll_exports.cpp'
]
2015-02-24 10:49:03 +01:00
if shell.compiler.cc.behavior == 'msvc':
shell.compiler.linkflags.remove('/SUBSYSTEM:WINDOWS')
shell.compiler.linkflags.append('/SUBSYSTEM:CONSOLE')
if builder.target_platform == 'linux':
shell.compiler.postlink += ['-lpthread', '-lrt']
builder.Add(shell)