Browse Source

wscript: strip lib prefix for HLSDK

hltopdown
Alibek Omarov 6 years ago
parent
commit
a699702c00
  1. 23
      cl_dll/wscript
  2. 21
      dlls/wscript
  3. 34
      wscript

23
cl_dll/wscript

@ -37,25 +37,22 @@ def build(bld): @@ -37,25 +37,22 @@ def build(bld):
'StudioModelRenderer.cpp', 'text_message.cpp', 'train.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')
defines = ['CLIENT_DLL']
if bld.env.GOLDSRC:
defines += ['GOLDSOURCE_SUPPORT']
libs = []
if bld.env.GOLDSRC:
libs += ['DL']
if bld.env.DEST_OS == 'win32':
libname = 'client.dll'
elif bld.env.DEST_OS == 'linux':
libname = 'client.so'
elif bld.env.DEST_OS == 'darwin':
libname = 'client.dylib'
else: libname = ''
if bld.env.DEST_OS2 not in ['android']:
install_path = os.path.join(bld.env.GAMEDIR, bld.env.CLIENT_DIR)
else:
install_path = bld.env.PREFIX
bld.shlib(
source = source,
target = 'client',
@ -63,7 +60,7 @@ def build(bld): @@ -63,7 +60,7 @@ def build(bld):
includes = includes,
defines = defines,
use = libs,
install_path = os.path.join(bld.env.GAMEDIR, bld.env.CLIENT_DIR, libname),
install_path = install_path,
subsystem = bld.env.MSVC_SUBSYSTEM,
idx = 1
)

21
dlls/wscript

@ -49,19 +49,16 @@ def build(bld): @@ -49,19 +49,16 @@ def build(bld):
])
else:
defines += ['NO_VOICEGAMEMGR']
includes = Utils.to_list('. wpn_shared ../common ../engine ../pm_shared ../game_shared ../public')
libs = []
if bld.env.DEST_OS == 'win32':
libname = bld.env.SERVER_NAME + '.dll'
elif bld.env.DEST_OS == 'linux':
libname = bld.env.SERVER_NAME + '.so'
elif bld.env.DEST_OS == 'darwin':
libname = bld.env.SERVER_NAME + '.dylib'
else: libname = ''
if bld.env.DEST_OS2 not in ['android']:
install_path = os.path.join(bld.env.GAMEDIR, bld.env.SERVER_DIR)
else:
install_path = bld.env.PREFIX
bld.shlib(
source = source,
target = 'server',
@ -69,7 +66,7 @@ def build(bld): @@ -69,7 +66,7 @@ def build(bld):
includes = includes,
defines = defines,
use = libs,
install_path = os.path.join(bld.env.GAMEDIR, bld.env.SERVER_DIR, libname),
install_path = install_path,
subsystem = bld.env.MSVC_SUBSYSTEM,
idx = 2
)

34
wscript

@ -21,15 +21,15 @@ def options(opt): @@ -21,15 +21,15 @@ def options(opt):
grp.add_option('-8', '--64bits', action = 'store_true', dest = 'ALLOW64', default = False,
help = 'allow targetting 64-bit game dlls')
grp.add_option('--enable-voicemgr', action = 'store_true', dest = 'VOICEMGR', default = False,
help = 'enable voice manager')
grp.add_option('--enable-goldsrc-support', action = 'store_true', dest = 'GOLDSRC', default = False,
help = 'enable GoldSource engine support')
opt.recurse('cl_dll dlls')
opt.load('xcompile compiler_cxx compiler_c')
if sys.platform == 'win32':
opt.load('msvc msdev')
@ -45,7 +45,7 @@ def configure(conf): @@ -45,7 +45,7 @@ def configure(conf):
conf.env.PREFIX = ''
conf.load('reconfigure')
conf.start_msg('Build type')
if conf.options.BUILD_TYPE == None:
conf.end_msg('not set', color='RED')
@ -58,7 +58,7 @@ def configure(conf): @@ -58,7 +58,7 @@ def configure(conf):
# -march=native should not be used
if conf.options.BUILD_TYPE == 'fast':
Logs.warn('WARNING: \'fast\' build type should not be used in release builds')
conf.env.VOICEMGR = conf.options.VOICEMGR
conf.env.GOLDSRC = conf.options.GOLDSRC
@ -71,6 +71,11 @@ def configure(conf): @@ -71,6 +71,11 @@ def configure(conf):
conf.load('msvc msdev')
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)
conf.env.BIT32_MANDATORY = not conf.options.ALLOW64
@ -122,24 +127,31 @@ def configure(conf): @@ -122,24 +127,31 @@ def configure(conf):
'default': ['-O0']
}
}
conf.env.append_unique('CFLAGS', fwgslib.get_flags_by_type(
compiler_c_cxx_flags, conf.options.BUILD_TYPE, conf.env.COMPILER_CC))
conf.env.append_unique('CXXFLAGS', fwgslib.get_flags_by_type(
compiler_c_cxx_flags, conf.options.BUILD_TYPE, conf.env.COMPILER_CC))
conf.env.append_unique('LINKFLAGS', fwgslib.get_flags_by_type(
linker_flags, conf.options.BUILD_TYPE, conf.env.COMPILER_CC))
if conf.env.COMPILER_CC == 'msvc':
conf.env.append_unique('DEFINES', ['_CRT_SECURE_NO_WARNINGS','_CRT_NONSTDC_NO_DEPRECATE'])
else:
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('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.recurse('cl_dll dlls')
def build(bld):

Loading…
Cancel
Save