Merge pull request #273 from alliedmodders/add-shell
Build the debug spshell as part of AMBuild.
This commit is contained in:
commit
38d2c3690a
@ -1,8 +1,7 @@
|
|||||||
# vim: set sts=2 ts=8 sw=2 tw=99 et ft=python:
|
# vim: set sts=2 ts=8 sw=2 tw=99 et ft=python:
|
||||||
import os
|
import os
|
||||||
|
|
||||||
binary = SM.Library(builder, 'sourcepawn.jit.x86')
|
Includes = [
|
||||||
binary.compiler.includes += [
|
|
||||||
os.path.join(SM.mms_root, 'core', 'sourcehook'),
|
os.path.join(SM.mms_root, 'core', 'sourcehook'),
|
||||||
os.path.join(builder.sourcePath, 'sourcepawn', 'jit'),
|
os.path.join(builder.sourcePath, 'sourcepawn', 'jit'),
|
||||||
os.path.join(builder.sourcePath, 'sourcepawn', 'jit', 'x86'),
|
os.path.join(builder.sourcePath, 'sourcepawn', 'jit', 'x86'),
|
||||||
@ -17,21 +16,23 @@ binary.compiler.includes += [
|
|||||||
os.path.join(builder.sourcePath, 'sourcepawn', 'include'),
|
os.path.join(builder.sourcePath, 'sourcepawn', 'include'),
|
||||||
]
|
]
|
||||||
|
|
||||||
if binary.compiler.vendor == 'gcc' or binary.compiler.vendor == 'clang':
|
def setup(binary):
|
||||||
binary.compiler.cxxflags += ['-fno-rtti']
|
compiler = binary.compiler
|
||||||
elif binary.compiler.vendor == 'msvc':
|
compiler.includes += Includes
|
||||||
binary.compiler.cxxflags += ['/GR-']
|
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
|
||||||
|
|
||||||
if builder.target_platform == 'linux':
|
# Build the static library.
|
||||||
binary.compiler.postlink += ['-lpthread', '-lrt']
|
library = setup(builder.compiler.StaticLibrary('sourcepawn'))
|
||||||
|
library.sources += [
|
||||||
if binary.compiler.cc.behavior == 'msvc':
|
|
||||||
binary.compiler.cxxflags.remove('/TP')
|
|
||||||
|
|
||||||
binary.sources += [
|
|
||||||
'plugin-runtime.cpp',
|
'plugin-runtime.cpp',
|
||||||
'compiled-function.cpp',
|
'compiled-function.cpp',
|
||||||
'dll_exports.cpp',
|
|
||||||
'engine2.cpp',
|
'engine2.cpp',
|
||||||
'sp_vm_basecontext.cpp',
|
'sp_vm_basecontext.cpp',
|
||||||
'sp_vm_engine.cpp',
|
'sp_vm_engine.cpp',
|
||||||
@ -56,4 +57,28 @@ binary.sources += [
|
|||||||
'../../knight/shared/KeCodeAllocator.cpp',
|
'../../knight/shared/KeCodeAllocator.cpp',
|
||||||
'../../public/jit/x86/assembler-x86.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)
|
||||||
|
@ -32,7 +32,6 @@
|
|||||||
#include <sp_vm_api.h>
|
#include <sp_vm_api.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
#include "x86/jit_x86.h"
|
|
||||||
#include "dll_exports.h"
|
#include "dll_exports.h"
|
||||||
#include "sp_vm_engine.h"
|
#include "sp_vm_engine.h"
|
||||||
#include "engine2.h"
|
#include "engine2.h"
|
||||||
|
Loading…
Reference in New Issue
Block a user