mirror of https://github.com/FWGS/hlsdk-xash3d
wscript: strip lib prefix for HLSDK
This commit is contained in:
parent
c27aec4c9c
commit
a699702c00
|
@ -37,25 +37,22 @@ def build(bld):
|
||||||
'StudioModelRenderer.cpp', 'text_message.cpp', 'train.cpp',
|
'StudioModelRenderer.cpp', 'text_message.cpp', 'train.cpp',
|
||||||
'tri.cpp', 'util.cpp', 'view.cpp', 'scoreboard.cpp', 'MOTD.cpp'
|
'tri.cpp', 'util.cpp', 'view.cpp', 'scoreboard.cpp', 'MOTD.cpp'
|
||||||
]
|
]
|
||||||
|
|
||||||
includes = Utils.to_list('. hl/ ../dlls ../dlls/wpn_shared ../common ../engine ../pm_shared ../game_shared ../public ../utils/false_vgui/include')
|
includes = Utils.to_list('. hl/ ../dlls ../dlls/wpn_shared ../common ../engine ../pm_shared ../game_shared ../public ../utils/false_vgui/include')
|
||||||
|
|
||||||
defines = ['CLIENT_DLL']
|
defines = ['CLIENT_DLL']
|
||||||
if bld.env.GOLDSRC:
|
if bld.env.GOLDSRC:
|
||||||
defines += ['GOLDSOURCE_SUPPORT']
|
defines += ['GOLDSOURCE_SUPPORT']
|
||||||
|
|
||||||
libs = []
|
libs = []
|
||||||
if bld.env.GOLDSRC:
|
if bld.env.GOLDSRC:
|
||||||
libs += ['DL']
|
libs += ['DL']
|
||||||
|
|
||||||
if bld.env.DEST_OS == 'win32':
|
if bld.env.DEST_OS2 not in ['android']:
|
||||||
libname = 'client.dll'
|
install_path = os.path.join(bld.env.GAMEDIR, bld.env.CLIENT_DIR)
|
||||||
elif bld.env.DEST_OS == 'linux':
|
else:
|
||||||
libname = 'client.so'
|
install_path = bld.env.PREFIX
|
||||||
elif bld.env.DEST_OS == 'darwin':
|
|
||||||
libname = 'client.dylib'
|
|
||||||
else: libname = ''
|
|
||||||
|
|
||||||
bld.shlib(
|
bld.shlib(
|
||||||
source = source,
|
source = source,
|
||||||
target = 'client',
|
target = 'client',
|
||||||
|
@ -63,7 +60,7 @@ def build(bld):
|
||||||
includes = includes,
|
includes = includes,
|
||||||
defines = defines,
|
defines = defines,
|
||||||
use = libs,
|
use = libs,
|
||||||
install_path = os.path.join(bld.env.GAMEDIR, bld.env.CLIENT_DIR, libname),
|
install_path = install_path,
|
||||||
subsystem = bld.env.MSVC_SUBSYSTEM,
|
subsystem = bld.env.MSVC_SUBSYSTEM,
|
||||||
idx = 1
|
idx = 1
|
||||||
)
|
)
|
||||||
|
|
21
dlls/wscript
21
dlls/wscript
|
@ -49,19 +49,16 @@ def build(bld):
|
||||||
])
|
])
|
||||||
else:
|
else:
|
||||||
defines += ['NO_VOICEGAMEMGR']
|
defines += ['NO_VOICEGAMEMGR']
|
||||||
|
|
||||||
includes = Utils.to_list('. wpn_shared ../common ../engine ../pm_shared ../game_shared ../public')
|
includes = Utils.to_list('. wpn_shared ../common ../engine ../pm_shared ../game_shared ../public')
|
||||||
|
|
||||||
libs = []
|
libs = []
|
||||||
|
|
||||||
if bld.env.DEST_OS == 'win32':
|
if bld.env.DEST_OS2 not in ['android']:
|
||||||
libname = bld.env.SERVER_NAME + '.dll'
|
install_path = os.path.join(bld.env.GAMEDIR, bld.env.SERVER_DIR)
|
||||||
elif bld.env.DEST_OS == 'linux':
|
else:
|
||||||
libname = bld.env.SERVER_NAME + '.so'
|
install_path = bld.env.PREFIX
|
||||||
elif bld.env.DEST_OS == 'darwin':
|
|
||||||
libname = bld.env.SERVER_NAME + '.dylib'
|
|
||||||
else: libname = ''
|
|
||||||
|
|
||||||
bld.shlib(
|
bld.shlib(
|
||||||
source = source,
|
source = source,
|
||||||
target = 'server',
|
target = 'server',
|
||||||
|
@ -69,7 +66,7 @@ def build(bld):
|
||||||
includes = includes,
|
includes = includes,
|
||||||
defines = defines,
|
defines = defines,
|
||||||
use = libs,
|
use = libs,
|
||||||
install_path = os.path.join(bld.env.GAMEDIR, bld.env.SERVER_DIR, libname),
|
install_path = install_path,
|
||||||
subsystem = bld.env.MSVC_SUBSYSTEM,
|
subsystem = bld.env.MSVC_SUBSYSTEM,
|
||||||
idx = 2
|
idx = 2
|
||||||
)
|
)
|
||||||
|
|
34
wscript
34
wscript
|
@ -21,15 +21,15 @@ def options(opt):
|
||||||
|
|
||||||
grp.add_option('-8', '--64bits', action = 'store_true', dest = 'ALLOW64', default = False,
|
grp.add_option('-8', '--64bits', action = 'store_true', dest = 'ALLOW64', default = False,
|
||||||
help = 'allow targetting 64-bit game dlls')
|
help = 'allow targetting 64-bit game dlls')
|
||||||
|
|
||||||
grp.add_option('--enable-voicemgr', action = 'store_true', dest = 'VOICEMGR', default = False,
|
grp.add_option('--enable-voicemgr', action = 'store_true', dest = 'VOICEMGR', default = False,
|
||||||
help = 'enable voice manager')
|
help = 'enable voice manager')
|
||||||
|
|
||||||
grp.add_option('--enable-goldsrc-support', action = 'store_true', dest = 'GOLDSRC', default = False,
|
grp.add_option('--enable-goldsrc-support', action = 'store_true', dest = 'GOLDSRC', default = False,
|
||||||
help = 'enable GoldSource engine support')
|
help = 'enable GoldSource engine support')
|
||||||
|
|
||||||
opt.recurse('cl_dll dlls')
|
opt.recurse('cl_dll dlls')
|
||||||
|
|
||||||
opt.load('xcompile compiler_cxx compiler_c')
|
opt.load('xcompile compiler_cxx compiler_c')
|
||||||
if sys.platform == 'win32':
|
if sys.platform == 'win32':
|
||||||
opt.load('msvc msdev')
|
opt.load('msvc msdev')
|
||||||
|
@ -45,7 +45,7 @@ def configure(conf):
|
||||||
conf.env.PREFIX = ''
|
conf.env.PREFIX = ''
|
||||||
|
|
||||||
conf.load('reconfigure')
|
conf.load('reconfigure')
|
||||||
|
|
||||||
conf.start_msg('Build type')
|
conf.start_msg('Build type')
|
||||||
if conf.options.BUILD_TYPE == None:
|
if conf.options.BUILD_TYPE == None:
|
||||||
conf.end_msg('not set', color='RED')
|
conf.end_msg('not set', color='RED')
|
||||||
|
@ -58,7 +58,7 @@ def configure(conf):
|
||||||
# -march=native should not be used
|
# -march=native should not be used
|
||||||
if conf.options.BUILD_TYPE == 'fast':
|
if conf.options.BUILD_TYPE == 'fast':
|
||||||
Logs.warn('WARNING: \'fast\' build type should not be used in release builds')
|
Logs.warn('WARNING: \'fast\' build type should not be used in release builds')
|
||||||
|
|
||||||
conf.env.VOICEMGR = conf.options.VOICEMGR
|
conf.env.VOICEMGR = conf.options.VOICEMGR
|
||||||
conf.env.GOLDSRC = conf.options.GOLDSRC
|
conf.env.GOLDSRC = conf.options.GOLDSRC
|
||||||
|
|
||||||
|
@ -71,6 +71,11 @@ def configure(conf):
|
||||||
conf.load('msvc msdev')
|
conf.load('msvc msdev')
|
||||||
conf.load('xcompile compiler_c compiler_cxx')
|
conf.load('xcompile compiler_c compiler_cxx')
|
||||||
|
|
||||||
|
if conf.env.DEST_OS2 == 'android':
|
||||||
|
conf.options.ALLOW64 = True
|
||||||
|
conf.options.GOLDSRC = False
|
||||||
|
conf.env.SERVER_NAME = 'server' # can't be any other name, until specified
|
||||||
|
|
||||||
# print(conf.options.ALLOW64)
|
# print(conf.options.ALLOW64)
|
||||||
|
|
||||||
conf.env.BIT32_MANDATORY = not conf.options.ALLOW64
|
conf.env.BIT32_MANDATORY = not conf.options.ALLOW64
|
||||||
|
@ -122,24 +127,31 @@ def configure(conf):
|
||||||
'default': ['-O0']
|
'default': ['-O0']
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
conf.env.append_unique('CFLAGS', fwgslib.get_flags_by_type(
|
conf.env.append_unique('CFLAGS', fwgslib.get_flags_by_type(
|
||||||
compiler_c_cxx_flags, conf.options.BUILD_TYPE, conf.env.COMPILER_CC))
|
compiler_c_cxx_flags, conf.options.BUILD_TYPE, conf.env.COMPILER_CC))
|
||||||
conf.env.append_unique('CXXFLAGS', fwgslib.get_flags_by_type(
|
conf.env.append_unique('CXXFLAGS', fwgslib.get_flags_by_type(
|
||||||
compiler_c_cxx_flags, conf.options.BUILD_TYPE, conf.env.COMPILER_CC))
|
compiler_c_cxx_flags, conf.options.BUILD_TYPE, conf.env.COMPILER_CC))
|
||||||
conf.env.append_unique('LINKFLAGS', fwgslib.get_flags_by_type(
|
conf.env.append_unique('LINKFLAGS', fwgslib.get_flags_by_type(
|
||||||
linker_flags, conf.options.BUILD_TYPE, conf.env.COMPILER_CC))
|
linker_flags, conf.options.BUILD_TYPE, conf.env.COMPILER_CC))
|
||||||
|
|
||||||
if conf.env.COMPILER_CC == 'msvc':
|
if conf.env.COMPILER_CC == 'msvc':
|
||||||
conf.env.append_unique('DEFINES', ['_CRT_SECURE_NO_WARNINGS','_CRT_NONSTDC_NO_DEPRECATE'])
|
conf.env.append_unique('DEFINES', ['_CRT_SECURE_NO_WARNINGS','_CRT_NONSTDC_NO_DEPRECATE'])
|
||||||
else:
|
else:
|
||||||
conf.env.append_unique('DEFINES', ['stricmp=strcasecmp','strnicmp=strncasecmp','_LINUX','LINUX','_snprintf=snprintf','_vsnprintf=vsnprintf'])
|
conf.env.append_unique('DEFINES', ['stricmp=strcasecmp','strnicmp=strncasecmp','_LINUX','LINUX','_snprintf=snprintf','_vsnprintf=vsnprintf'])
|
||||||
cflags = ['-fvisibility=hidden','-Wno-write-strings','-fno-exceptions']
|
cflags = ['-fvisibility=hidden','-Wno-write-strings','-fno-exceptions','-fno-rtti']
|
||||||
conf.env.append_unique('CFLAGS', cflags)
|
conf.env.append_unique('CFLAGS', cflags)
|
||||||
conf.env.append_unique('CXXFLAGS', cflags + ['-Wno-invalid-offsetof'])
|
conf.env.append_unique('CXXFLAGS', cflags + ['-Wno-invalid-offsetof'])
|
||||||
|
|
||||||
|
# strip lib from pattern
|
||||||
|
if conf.env.DEST_OS in ['linux', 'darwin'] and conf.env.DEST_OS2 not in ['android']:
|
||||||
|
if conf.env.cshlib_PATTERN.startswith('lib'):
|
||||||
|
conf.env.cshlib_PATTERN = conf.env.cshlib_PATTERN[3:]
|
||||||
|
if conf.env.cxxshlib_PATTERN.startswith('lib'):
|
||||||
|
conf.env.cxxshlib_PATTERN = conf.env.cxxshlib_PATTERN[3:]
|
||||||
|
|
||||||
conf.env.append_unique('DEFINES', 'CLIENT_WEAPONS')
|
conf.env.append_unique('DEFINES', 'CLIENT_WEAPONS')
|
||||||
|
|
||||||
conf.recurse('cl_dll dlls')
|
conf.recurse('cl_dll dlls')
|
||||||
|
|
||||||
def build(bld):
|
def build(bld):
|
||||||
|
|
Loading…
Reference in New Issue