2013-12-30 23:50:56 +01:00
|
|
|
# vim: set sts=2 ts=8 sw=2 tw=99 et ft=python:
|
2009-08-30 09:46:56 +02:00
|
|
|
import os
|
|
|
|
|
2015-02-24 05:21:17 +01:00
|
|
|
Includes = [
|
2013-12-30 23:50:56 +01:00
|
|
|
os.path.join(SM.mms_root, 'core', 'sourcehook'),
|
|
|
|
os.path.join(builder.sourcePath, 'sourcepawn', 'jit'),
|
|
|
|
os.path.join(builder.sourcePath, 'sourcepawn', 'jit', 'x86'),
|
|
|
|
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'),
|
|
|
|
os.path.join(builder.sourcePath, 'knight', 'shared'),
|
2014-08-22 07:16:07 +02:00
|
|
|
|
|
|
|
# The include path for SP v2 stuff.
|
|
|
|
os.path.join(builder.sourcePath, 'sourcepawn', 'include'),
|
2013-12-30 23:50:56 +01:00
|
|
|
]
|
2009-08-30 09:46:56 +02:00
|
|
|
|
2015-02-24 05:21:17 +01: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
|
2014-09-12 02:15:59 +02:00
|
|
|
|
2015-02-24 05:21:17 +01:00
|
|
|
# Build the static library.
|
|
|
|
library = setup(builder.compiler.StaticLibrary('sourcepawn'))
|
|
|
|
library.sources += [
|
2015-02-24 01:44:15 +01:00
|
|
|
'plugin-runtime.cpp',
|
2015-02-24 01:04:57 +01:00
|
|
|
'compiled-function.cpp',
|
|
|
|
'engine2.cpp',
|
2013-12-30 23:50:56 +01:00
|
|
|
'sp_vm_basecontext.cpp',
|
|
|
|
'sp_vm_engine.cpp',
|
2015-02-24 01:14:59 +01:00
|
|
|
'scripted-invoker.cpp',
|
2013-12-30 23:50:56 +01:00
|
|
|
'opcodes.cpp',
|
|
|
|
'interpreter.cpp',
|
|
|
|
'watchdog_timer.cpp',
|
|
|
|
'x86/jit_x86.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',
|
|
|
|
'../../knight/shared/KeCodeAllocator.cpp',
|
|
|
|
'../../public/jit/x86/assembler-x86.cpp',
|
|
|
|
]
|
2015-02-24 05:21:17 +01:00
|
|
|
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'
|
|
|
|
]
|
|
|
|
|
|
|
|
if builder.target_platform == 'linux':
|
|
|
|
shell.compiler.postlink += ['-lpthread', '-lrt']
|
|
|
|
builder.Add(shell)
|