Merge pull request #273 from alliedmodders/add-shell

Build the debug spshell as part of AMBuild.
This commit is contained in:
David Anderson 2015-02-23 20:28:30 -08:00
commit 38d2c3690a
2 changed files with 40 additions and 16 deletions

View File

@ -1,8 +1,7 @@
# vim: set sts=2 ts=8 sw=2 tw=99 et ft=python:
import os
binary = SM.Library(builder, 'sourcepawn.jit.x86')
binary.compiler.includes += [
Includes = [
os.path.join(SM.mms_root, 'core', 'sourcehook'),
os.path.join(builder.sourcePath, 'sourcepawn', 'jit'),
os.path.join(builder.sourcePath, 'sourcepawn', 'jit', 'x86'),
@ -17,21 +16,23 @@ binary.compiler.includes += [
os.path.join(builder.sourcePath, 'sourcepawn', 'include'),
]
if binary.compiler.vendor == 'gcc' or binary.compiler.vendor == 'clang':
binary.compiler.cxxflags += ['-fno-rtti']
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':
binary.compiler.cxxflags += ['/GR-']
if builder.target_platform == 'linux':
binary.compiler.postlink += ['-lpthread', '-lrt']
compiler.cxxflags += ['/GR-']
if binary.compiler.cc.behavior == 'msvc':
binary.compiler.cxxflags.remove('/TP')
compiler.cxxflags.remove('/TP')
return binary
binary.sources += [
# Build the static library.
library = setup(builder.compiler.StaticLibrary('sourcepawn'))
library.sources += [
'plugin-runtime.cpp',
'compiled-function.cpp',
'dll_exports.cpp',
'engine2.cpp',
'sp_vm_basecontext.cpp',
'sp_vm_engine.cpp',
@ -56,4 +57,28 @@ binary.sources += [
'../../knight/shared/KeCodeAllocator.cpp',
'../../public/jit/x86/assembler-x86.cpp',
]
SM.binaries += [builder.Add(binary)]
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)

View File

@ -32,7 +32,6 @@
#include <sp_vm_api.h>
#include <stdlib.h>
#include <stdarg.h>
#include "x86/jit_x86.h"
#include "dll_exports.h"
#include "sp_vm_engine.h"
#include "engine2.h"