mirror of
https://github.com/YGGverse/hlsdk-portable.git
synced 2025-01-11 15:38:12 +00:00
parent
5c771b851a
commit
c2e3b70b37
43
wscript
43
wscript
@ -7,7 +7,6 @@ from waflib import Logs
|
|||||||
import sys
|
import sys
|
||||||
import os
|
import os
|
||||||
sys.path.append(os.path.realpath('scripts/waflib'))
|
sys.path.append(os.path.realpath('scripts/waflib'))
|
||||||
import fwgslib
|
|
||||||
|
|
||||||
VERSION = '2.4'
|
VERSION = '2.4'
|
||||||
APPNAME = 'hlsdk-xash3d'
|
APPNAME = 'hlsdk-xash3d'
|
||||||
@ -89,50 +88,50 @@ def configure(conf):
|
|||||||
|
|
||||||
linker_flags = {
|
linker_flags = {
|
||||||
'common': {
|
'common': {
|
||||||
'msvc': ['/DEBUG'], # always create PDB, doesn't affect result binaries
|
'msvc': ['/DEBUG'], # always create PDB, doesn't affect result binaries
|
||||||
'gcc': ['-Wl,--no-undefined']
|
'gcc': ['-Wl,--no-undefined']
|
||||||
},
|
},
|
||||||
'sanitize': {
|
'sanitize': {
|
||||||
'gcc': ['-fsanitize=undefined', '-fsanitize=address'],
|
'gcc': ['-fsanitize=undefined', '-fsanitize=address'],
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
compiler_c_cxx_flags = {
|
compiler_c_cxx_flags = {
|
||||||
'common': {
|
'common': {
|
||||||
'msvc': ['/D_USING_V110_SDK71_', '/Zi', '/FS'],
|
'msvc': ['/D_USING_V110_SDK71_', '/Zi', '/FS'],
|
||||||
'clang': ['-g', '-gdwarf-2'],
|
'clang': ['-g', '-gdwarf-2'],
|
||||||
'gcc': ['-g', '-Werror=implicit-function-declaration', '-fdiagnostics-color=always']
|
'gcc': ['-g', '-Werror=implicit-function-declaration', '-fdiagnostics-color=always']
|
||||||
},
|
},
|
||||||
'fast': {
|
'fast': {
|
||||||
'msvc': ['/O2', '/Oy'], #todo: check /GL /LTCG
|
'msvc': ['/O2', '/Oy'], #todo: check /GL /LTCG
|
||||||
'gcc': ['-Ofast', '-march=native', '-funsafe-math-optimizations', '-funsafe-loop-optimizations', '-fomit-frame-pointer'],
|
'gcc': ['-Ofast', '-march=native', '-funsafe-math-optimizations', '-funsafe-loop-optimizations', '-fomit-frame-pointer'],
|
||||||
'default': ['-O3']
|
'default': ['-O3']
|
||||||
},
|
},
|
||||||
'release': {
|
'release': {
|
||||||
'msvc': ['/O2'],
|
'msvc': ['/O2'],
|
||||||
'default': ['-O3']
|
'default': ['-O3']
|
||||||
},
|
},
|
||||||
'debug': {
|
'debug': {
|
||||||
'msvc': ['/O1'],
|
'msvc': ['/O1'],
|
||||||
'gcc': ['-Og'],
|
'gcc': ['-Og'],
|
||||||
'default': ['-O1']
|
'default': ['-O1']
|
||||||
},
|
},
|
||||||
'sanitize': {
|
'sanitize': {
|
||||||
'msvc': ['/Od', '/RTC1'],
|
'msvc': ['/Od', '/RTC1'],
|
||||||
'gcc': ['-Og', '-fsanitize=undefined', '-fsanitize=address'],
|
'gcc': ['-Og', '-fsanitize=undefined', '-fsanitize=address'],
|
||||||
'default': ['-O1']
|
'default': ['-O1']
|
||||||
},
|
},
|
||||||
'nooptimize': {
|
'nooptimize': {
|
||||||
'msvc': ['/Od'],
|
'msvc': ['/Od'],
|
||||||
'default': ['-O0']
|
'default': ['-O0']
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
conf.env.append_unique('CFLAGS', fwgslib.get_flags_by_type(
|
conf.env.append_unique('CFLAGS', conf.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', conf.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', conf.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':
|
||||||
@ -144,11 +143,11 @@ def configure(conf):
|
|||||||
conf.env.append_unique('CXXFLAGS', cflags + ['-Wno-invalid-offsetof', '-fno-rtti', '-fno-exceptions'])
|
conf.env.append_unique('CXXFLAGS', cflags + ['-Wno-invalid-offsetof', '-fno-rtti', '-fno-exceptions'])
|
||||||
|
|
||||||
# strip lib from pattern
|
# strip lib from pattern
|
||||||
if conf.env.DEST_OS in ['linux', 'darwin'] and conf.env.DEST_OS2 not in ['android']:
|
if conf.env.DEST_OS in ['linux', 'darwin'] and conf.env.DEST_OS2 not in ['android']:
|
||||||
if conf.env.cshlib_PATTERN.startswith('lib'):
|
if conf.env.cshlib_PATTERN.startswith('lib'):
|
||||||
conf.env.cshlib_PATTERN = conf.env.cshlib_PATTERN[3:]
|
conf.env.cshlib_PATTERN = conf.env.cshlib_PATTERN[3:]
|
||||||
if conf.env.cxxshlib_PATTERN.startswith('lib'):
|
if conf.env.cxxshlib_PATTERN.startswith('lib'):
|
||||||
conf.env.cxxshlib_PATTERN = conf.env.cxxshlib_PATTERN[3:]
|
conf.env.cxxshlib_PATTERN = conf.env.cxxshlib_PATTERN[3:]
|
||||||
|
|
||||||
conf.env.append_unique('DEFINES', 'CLIENT_WEAPONS')
|
conf.env.append_unique('DEFINES', 'CLIENT_WEAPONS')
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user