mirror of
https://github.com/YGGverse/xash3d-fwgs.git
synced 2025-01-11 07:37:52 +00:00
mdldec: add wscript, disabled by default
This commit is contained in:
parent
586d613a27
commit
add4cf4232
33
utils/mdldec/wscript
Normal file
33
utils/mdldec/wscript
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
#! /usr/bin/env python
|
||||||
|
# encoding: utf-8
|
||||||
|
# a1batross, mittorn, 2018
|
||||||
|
|
||||||
|
def options(opt):
|
||||||
|
# TODO: any options for mdldec?
|
||||||
|
grp = opt.get_option_group('Utilities options')
|
||||||
|
|
||||||
|
grp.add_option('--disable-utils-mdldec', action = 'store_true', dest = 'DISABLE_UTILS_MDLDEC', default = False,
|
||||||
|
help = 'disable studio model decompiler utility [default: %default]')
|
||||||
|
|
||||||
|
def configure(conf):
|
||||||
|
conf.env.DISABLE_UTILS_MDLDEC = conf.options.DISABLE_UTILS_MDLDEC
|
||||||
|
|
||||||
|
def build(bld):
|
||||||
|
if bld.env.DISABLE_UTILS_MDLDEC:
|
||||||
|
return
|
||||||
|
|
||||||
|
source = bld.path.ant_glob('*.c')
|
||||||
|
includes = '. ../../common ../../engine ../../engine/common ../../engine/common/imagelib ../../public'
|
||||||
|
libs = [ 'public', 'M' ]
|
||||||
|
|
||||||
|
bld(
|
||||||
|
source = source,
|
||||||
|
target = 'mdldec',
|
||||||
|
features = 'c cprogram',
|
||||||
|
includes = includes,
|
||||||
|
use = libs,
|
||||||
|
install_path = bld.env.BINDIR,
|
||||||
|
subsystem = bld.env.MSVC_SUBSYSTEM
|
||||||
|
)
|
||||||
|
|
||||||
|
bld.install_files(bld.env.SHAREDIR, 'res/activities.txt')
|
16
wscript
16
wscript
@ -20,11 +20,12 @@ class Subproject:
|
|||||||
ignore = False # if true will be ignored, set by user request
|
ignore = False # if true will be ignored, set by user request
|
||||||
mandatory = False
|
mandatory = False
|
||||||
|
|
||||||
def __init__(self, name, dedicated=True, singlebin=False, mandatory = False):
|
def __init__(self, name, dedicated=True, singlebin=False, mandatory = False, utility = False):
|
||||||
self.name = name
|
self.name = name
|
||||||
self.dedicated = dedicated
|
self.dedicated = dedicated
|
||||||
self.singlebin = singlebin
|
self.singlebin = singlebin
|
||||||
self.mandatory = mandatory
|
self.mandatory = mandatory
|
||||||
|
self.utility = utility
|
||||||
|
|
||||||
def is_enabled(self, ctx):
|
def is_enabled(self, ctx):
|
||||||
if not self.mandatory:
|
if not self.mandatory:
|
||||||
@ -43,6 +44,9 @@ class Subproject:
|
|||||||
if ctx.env.DEDICATED and self.dedicated:
|
if ctx.env.DEDICATED and self.dedicated:
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
if self.utility and not ctx.env.ENABLE_UTILS:
|
||||||
|
return False
|
||||||
|
|
||||||
return True
|
return True
|
||||||
|
|
||||||
SUBDIRS = [
|
SUBDIRS = [
|
||||||
@ -56,6 +60,7 @@ SUBDIRS = [
|
|||||||
Subproject('stub/client'),
|
Subproject('stub/client'),
|
||||||
Subproject('dllemu'),
|
Subproject('dllemu'),
|
||||||
Subproject('engine', dedicated=False),
|
Subproject('engine', dedicated=False),
|
||||||
|
Subproject('utils/mdldec', utility=True)
|
||||||
]
|
]
|
||||||
|
|
||||||
def subdirs():
|
def subdirs():
|
||||||
@ -85,6 +90,11 @@ def options(opt):
|
|||||||
grp.add_option('--ignore-projects', action = 'store', dest = 'IGNORE_PROJECTS', default = None,
|
grp.add_option('--ignore-projects', action = 'store', dest = 'IGNORE_PROJECTS', default = None,
|
||||||
help = 'disable selected projects from build [default: %default]')
|
help = 'disable selected projects from build [default: %default]')
|
||||||
|
|
||||||
|
grp = opt.add_option_group('Utilities options')
|
||||||
|
|
||||||
|
grp.add_option('--enable-utils', action = 'store_true', dest = 'ENABLE_UTILS', default = False,
|
||||||
|
help = 'enable building various development utilities [default: %default]')
|
||||||
|
|
||||||
opt.load('compiler_optimizations subproject')
|
opt.load('compiler_optimizations subproject')
|
||||||
|
|
||||||
for i in SUBDIRS:
|
for i in SUBDIRS:
|
||||||
@ -220,6 +230,7 @@ def configure(conf):
|
|||||||
# include portable stdint by Paul Hsich
|
# include portable stdint by Paul Hsich
|
||||||
conf.define('STDINT_H', 'pstdint.h')
|
conf.define('STDINT_H', 'pstdint.h')
|
||||||
|
|
||||||
|
conf.env.ENABLE_UTILS = conf.options.ENABLE_UTILS
|
||||||
conf.env.DEDICATED = conf.options.DEDICATED
|
conf.env.DEDICATED = conf.options.DEDICATED
|
||||||
conf.env.SINGLE_BINARY = conf.options.SINGLE_BINARY or conf.env.DEDICATED
|
conf.env.SINGLE_BINARY = conf.options.SINGLE_BINARY or conf.env.DEDICATED
|
||||||
if conf.env.DEST_OS == 'dos':
|
if conf.env.DEST_OS == 'dos':
|
||||||
@ -271,8 +282,9 @@ def configure(conf):
|
|||||||
# indicate if we are packaging for Linux/BSD
|
# indicate if we are packaging for Linux/BSD
|
||||||
if not conf.options.WIN_INSTALL and conf.env.DEST_OS not in ['win32', 'darwin', 'android']:
|
if not conf.options.WIN_INSTALL and conf.env.DEST_OS not in ['win32', 'darwin', 'android']:
|
||||||
conf.env.LIBDIR = conf.env.BINDIR = '${PREFIX}/lib/xash3d'
|
conf.env.LIBDIR = conf.env.BINDIR = '${PREFIX}/lib/xash3d'
|
||||||
|
conf.env.SHAREDIR = '${PREFIX}/share/xash3d'
|
||||||
else:
|
else:
|
||||||
conf.env.LIBDIR = conf.env.BINDIR = conf.env.PREFIX
|
conf.env.SHAREDIR = conf.env.LIBDIR = conf.env.BINDIR = conf.env.PREFIX
|
||||||
|
|
||||||
conf.define('XASH_BUILD_COMMIT', conf.env.GIT_VERSION if conf.env.GIT_VERSION else 'notset')
|
conf.define('XASH_BUILD_COMMIT', conf.env.GIT_VERSION if conf.env.GIT_VERSION else 'notset')
|
||||||
conf.define('XASH_LOW_MEMORY', conf.options.LOW_MEMORY)
|
conf.define('XASH_LOW_MEMORY', conf.options.LOW_MEMORY)
|
||||||
|
Loading…
Reference in New Issue
Block a user