Browse Source

wscript: strip lib prefix for HLSDK

hltopdown
Alibek Omarov 6 years ago
parent
commit
a699702c00
  1. 13
      cl_dll/wscript
  2. 13
      dlls/wscript
  3. 14
      wscript

13
cl_dll/wscript

@ -48,13 +48,10 @@ def build(bld):
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,
@ -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
) )

13
dlls/wscript

@ -54,13 +54,10 @@ def build(bld):
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,
@ -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
) )

14
wscript

@ -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
@ -134,10 +139,17 @@ def configure(conf):
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')

Loading…
Cancel
Save