mirror of
https://github.com/YGGverse/xash3d-fwgs.git
synced 2025-01-25 14:24:45 +00:00
engine: wscript: support building for MotoMAGX
This commit is contained in:
parent
6aa61657e0
commit
9aff6ca633
@ -20,12 +20,26 @@ def options(opt):
|
|||||||
grp.add_option('--enable-custom-swap', action = 'store_true', dest = 'CUSTOM_SWAP', default = False,
|
grp.add_option('--enable-custom-swap', action = 'store_true', dest = 'CUSTOM_SWAP', default = False,
|
||||||
help = 'enable custom swap allocator. For devices with no swap support')
|
help = 'enable custom swap allocator. For devices with no swap support')
|
||||||
|
|
||||||
|
grp.add_option('--enable-magx', action = 'store_true', dest = 'MAGX', default = False,
|
||||||
|
help = 'enable targetting for MotoMAGX phones [default: %default]')
|
||||||
|
|
||||||
grp.add_option('--enable-legacy-sdl', action = 'store_true', dest = 'SDL12', default = False,
|
grp.add_option('--enable-legacy-sdl', action = 'store_true', dest = 'SDL12', default = False,
|
||||||
help = 'enable using SDL1.2 instead of SDL2(not recommended) [default: %default')
|
help = 'enable using SDL1.2 instead of SDL2(not recommended) [default: %default')
|
||||||
|
|
||||||
opt.load('sdl2')
|
opt.load('sdl2')
|
||||||
|
|
||||||
def configure(conf):
|
def configure(conf):
|
||||||
|
conf.env.MAGX = conf.options.MAGX
|
||||||
|
if conf.options.MAGX:
|
||||||
|
# useless to change toolchain path, as toolchain meant to be placed in this path
|
||||||
|
toolchain_path = '/opt/toolchains/motomagx/arm-eabi2/lib/'
|
||||||
|
conf.env.INCLUDES_MAGX = [toolchain_path + i for i in ['ezx-z6/include', 'qt-2.3.8/include']]
|
||||||
|
conf.env.LIBPATH_MAGX = [toolchain_path + i for i in ['ezx-z6/lib', 'qt-2.3.8/lib']]
|
||||||
|
conf.env.LINKFLAGS_MAGX = ['-Wl,-rpath-link=' + i for i in conf.env.LIBPATH_MAGX]
|
||||||
|
for lib in ['qte-mt', 'ezxappbase', 'ezxpm', 'log_util']:
|
||||||
|
conf.check_cc(lib=lib, use='MAGX', uselib_store='MAGX')
|
||||||
|
conf.options.SDL12 = True
|
||||||
|
|
||||||
# check for dedicated server build
|
# check for dedicated server build
|
||||||
if conf.options.DEDICATED:
|
if conf.options.DEDICATED:
|
||||||
if conf.env.DEST_OS == 'linux':
|
if conf.env.DEST_OS == 'linux':
|
||||||
@ -69,6 +83,7 @@ def configure(conf):
|
|||||||
conf.define_cond('PSAPI_VERSION', conf.env.DEST_OS == 'win32') # will be defined as 1
|
conf.define_cond('PSAPI_VERSION', conf.env.DEST_OS == 'win32') # will be defined as 1
|
||||||
|
|
||||||
def build(bld):
|
def build(bld):
|
||||||
|
is_cxx_link = False
|
||||||
libs = [ 'public' ]
|
libs = [ 'public' ]
|
||||||
source = bld.path.ant_glob([
|
source = bld.path.ant_glob([
|
||||||
'common/*.c',
|
'common/*.c',
|
||||||
@ -96,6 +111,11 @@ def build(bld):
|
|||||||
libs.append('SDL2')
|
libs.append('SDL2')
|
||||||
source += bld.path.ant_glob(['platform/sdl/*.c'])
|
source += bld.path.ant_glob(['platform/sdl/*.c'])
|
||||||
|
|
||||||
|
if bld.env.MAGX:
|
||||||
|
libs.append('MAGX')
|
||||||
|
source += bld.path.ant_glob(['platform/magx/*.cpp'])
|
||||||
|
is_cxx_link = True
|
||||||
|
|
||||||
if bld.env.DEST_OS == 'android':
|
if bld.env.DEST_OS == 'android':
|
||||||
libs += ['LOG', 'EGL', 'ANDROID']
|
libs += ['LOG', 'EGL', 'ANDROID']
|
||||||
source += bld.path.ant_glob(['platform/android/*.cpp', 'platform/android/*.c', 'platform/linux/*.c'])
|
source += bld.path.ant_glob(['platform/android/*.cpp', 'platform/android/*.c', 'platform/linux/*.c'])
|
||||||
@ -112,10 +132,10 @@ def build(bld):
|
|||||||
|
|
||||||
if bld.env.SINGLE_BINARY:
|
if bld.env.SINGLE_BINARY:
|
||||||
install_path = bld.env.BINDIR
|
install_path = bld.env.BINDIR
|
||||||
features = 'c cprogram'
|
features = ['c', 'cxxprogram' if is_cxx_link else 'cprogram']
|
||||||
else:
|
else:
|
||||||
install_path = bld.env.LIBDIR
|
install_path = bld.env.LIBDIR
|
||||||
features = 'c cshlib'
|
features = ['c', 'cxxshlib' if is_cxx_link else 'cshlib']
|
||||||
|
|
||||||
bld(source = source,
|
bld(source = source,
|
||||||
target = 'xash',
|
target = 'xash',
|
||||||
|
Loading…
x
Reference in New Issue
Block a user