mirror of
https://github.com/YGGverse/xash3d-fwgs.git
synced 2025-01-27 23:34:29 +00:00
wscript: more paranoic Werrors
This commit is contained in:
parent
cb62e65f9f
commit
e6dd4882cc
34
wscript
34
wscript
@ -3,7 +3,7 @@
|
|||||||
# a1batross, mittorn, 2018
|
# a1batross, mittorn, 2018
|
||||||
|
|
||||||
from __future__ import print_function
|
from __future__ import print_function
|
||||||
from waflib import Logs
|
from waflib import Logs, Context, Configure
|
||||||
import sys
|
import sys
|
||||||
import os
|
import os
|
||||||
|
|
||||||
@ -11,6 +11,8 @@ VERSION = '0.99'
|
|||||||
APPNAME = 'xash3d-fwgs'
|
APPNAME = 'xash3d-fwgs'
|
||||||
top = '.'
|
top = '.'
|
||||||
|
|
||||||
|
Context.Context.line_just = 55 # should fit for everything on 80x26
|
||||||
|
|
||||||
class Subproject:
|
class Subproject:
|
||||||
name = ''
|
name = ''
|
||||||
dedicated = True # if true will be ignored when building dedicated server
|
dedicated = True # if true will be ignored when building dedicated server
|
||||||
@ -65,12 +67,12 @@ def options(opt):
|
|||||||
opt.load('msvc msdev msvs')
|
opt.load('msvc msdev msvs')
|
||||||
opt.load('reconfigure')
|
opt.load('reconfigure')
|
||||||
|
|
||||||
|
@Configure.conf
|
||||||
def filter_cflags(conf, flags, required_flags, cxx):
|
def filter_cflags(conf, flags, required_flags, cxx):
|
||||||
supported_flags = []
|
supported_flags = []
|
||||||
check_flags = required_flags + ['-Werror']
|
check_flags = required_flags + ['-Werror']
|
||||||
conf.msg('Detecting supported flags for %s' % ('C++' if cxx else 'C'),'...')
|
conf.msg('Detecting supported flags for %s' % ('C++' if cxx else 'C'), '...')
|
||||||
|
|
||||||
for flag in flags:
|
for flag in flags:
|
||||||
conf.start_msg('Checking for %s' % flag)
|
conf.start_msg('Checking for %s' % flag)
|
||||||
try:
|
try:
|
||||||
@ -119,7 +121,6 @@ def configure(conf):
|
|||||||
|
|
||||||
# modify options dictionary early
|
# modify options dictionary early
|
||||||
if conf.env.DEST_OS == 'android':
|
if conf.env.DEST_OS == 'android':
|
||||||
conf.options.ALLOW64 = True # skip pointer length check
|
|
||||||
conf.options.NO_VGUI = True # skip vgui
|
conf.options.NO_VGUI = True # skip vgui
|
||||||
conf.options.NANOGL = True
|
conf.options.NANOGL = True
|
||||||
conf.options.GLWES = True
|
conf.options.GLWES = True
|
||||||
@ -189,8 +190,24 @@ def configure(conf):
|
|||||||
'-Werror=int-conversion',
|
'-Werror=int-conversion',
|
||||||
'-Werror=return-type',
|
'-Werror=return-type',
|
||||||
'-Werror=parentheses',
|
'-Werror=parentheses',
|
||||||
|
'-Werror=vla',
|
||||||
|
'-Werror=tautological-compare',
|
||||||
|
'-Werror=duplicated-cond',
|
||||||
|
'-Werror=duplicated-branches', # BEWARE: buggy
|
||||||
|
'-Werror=bool-compare',
|
||||||
|
'-Werror=bool-operation',
|
||||||
|
'-Wstrict-aliasing',
|
||||||
]
|
]
|
||||||
|
|
||||||
|
c_compiler_optional_flags = [
|
||||||
|
'-Werror=implicit-int',
|
||||||
|
'-Werror=strict-prototypes',
|
||||||
|
'-Werror=old-style-declaration',
|
||||||
|
'-Werror=old-style-definition',
|
||||||
|
'-Werror=declaration-after-statement'
|
||||||
|
]
|
||||||
|
|
||||||
|
|
||||||
conf.env.append_unique('LINKFLAGS', conf.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))
|
||||||
|
|
||||||
@ -201,9 +218,9 @@ def configure(conf):
|
|||||||
else:
|
else:
|
||||||
conf.check_cc(cflags=cflags, msg= 'Checking for required C flags')
|
conf.check_cc(cflags=cflags, msg= 'Checking for required C flags')
|
||||||
conf.check_cxx(cxxflags=cflags, msg= 'Checking for required C++ flags')
|
conf.check_cxx(cxxflags=cflags, msg= 'Checking for required C++ flags')
|
||||||
|
|
||||||
conf.env.append_unique('CFLAGS', cflags + filter_cflags(conf, compiler_optional_flags, cflags, False))
|
conf.env.append_unique('CFLAGS', cflags + conf.filter_cflags(compiler_optional_flags + c_compiler_optional_flags, cflags, False))
|
||||||
conf.env.append_unique('CXXFLAGS', cflags + filter_cflags(conf, compiler_optional_flags, cflags, True))
|
conf.env.append_unique('CXXFLAGS', cflags + conf.filter_cflags(compiler_optional_flags, cflags, True))
|
||||||
|
|
||||||
|
|
||||||
conf.env.DEDICATED = conf.options.DEDICATED
|
conf.env.DEDICATED = conf.options.DEDICATED
|
||||||
@ -231,7 +248,6 @@ def configure(conf):
|
|||||||
conf.check_cc( lib='psapi' )
|
conf.check_cc( lib='psapi' )
|
||||||
conf.check_cc( lib='ws2_32' )
|
conf.check_cc( lib='ws2_32' )
|
||||||
|
|
||||||
|
|
||||||
# indicate if we are packaging for Linux/BSD
|
# indicate if we are packaging for Linux/BSD
|
||||||
if(not conf.options.WIN_INSTALL and
|
if(not conf.options.WIN_INSTALL and
|
||||||
conf.env.DEST_OS not in ['win32', 'darwin', 'android']):
|
conf.env.DEST_OS not in ['win32', 'darwin', 'android']):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user