From 816cc2383362305d14852c8feedd9c34e695b6ec Mon Sep 17 00:00:00 2001 From: nillerusr Date: Mon, 16 May 2022 00:00:37 +0300 Subject: [PATCH] wscript: add --disable-warns option --- wscript | 47 ++++++++++++++++++++++++++++++++--------------- 1 file changed, 32 insertions(+), 15 deletions(-) diff --git a/wscript b/wscript index 6624260e..b3b87b0d 100644 --- a/wscript +++ b/wscript @@ -211,6 +211,9 @@ def options(opt): grp.add_option('--use-ccache', action = 'store_true', dest = 'CCACHE', default = False, help = 'build using ccache [default: %default]') + grp.add_option('--disable-warns', action = 'store_true', dest = 'DISABLE_WARNS', default = False, + help = 'build using ccache [default: %default]') + grp.add_option('--togles', action = 'store_true', dest = 'TOGLES', default = False, help = 'build engine with ToGLES [default: %default]') @@ -252,17 +255,18 @@ def configure(conf): conf.load('force_32bit') - compiler_optional_flags = [ - '-pipe', - '-Wall', - '-fdiagnostics-color=always', - '-Wcast-align', - '-Wuninitialized', - '-Winit-self', - '-Wstrict-aliasing', - '-faligned-new' - # '-Werror=strict-aliasing' - ] + if conf.options.DISABLE_WARNS: + compiler_optional_flags = ['-w'] + else: + compiler_optional_flags = [ + '-Wall', + '-fdiagnostics-color=always', + '-Wcast-align', + '-Wuninitialized', + '-Winit-self', + '-Wstrict-aliasing', + '-faligned-new', + ] c_compiler_optional_flags = [ '-fnonconst-initializers' # owcc @@ -270,7 +274,9 @@ def configure(conf): cflags, linkflags = conf.get_optimization_flags() - flags = ['-fPIC'] #, '-fsanitize=undefined'] + flags = ['-fPIC', '-pipe'] #, '-fsanitize=undefined', '-fno-sanitize=vptr'] #, '-fno-sanitize=vptr,shift,shift-exponent,shift-base,signed-integer-overflow'] + if conf.env.COMPILER_CC != 'msvc': + flags += ['-pthread'] if conf.env.DEST_OS == 'android': flags += [ @@ -290,7 +296,7 @@ def configure(conf): if conf.env.DEST_OS != 'android': flags += ['-march=native', '-mtune=native'] else: - flags += ['-march=native','-mtune=native','-mfpmath=sse', '-msse', '-msse2'] + flags += ['-march=native','-mtune=native','-mfpmath=sse'] cflags += flags @@ -307,7 +313,6 @@ def configure(conf): # for func in wrapfunctions: # linkflags += ['-Wl,--wrap='+func] - conf.define('COMPILER_GCC', 1) @@ -315,7 +320,6 @@ def configure(conf): conf.check_cc(cflags=cflags, linkflags=linkflags, msg='Checking for required C flags') conf.check_cxx(cxxflags=cxxflags, linkflags=linkflags, msg='Checking for required C++ flags') - linkflags += ['-pthread'] conf.env.append_unique('CFLAGS', cflags) conf.env.append_unique('CXXFLAGS', cxxflags) conf.env.append_unique('LINKFLAGS', linkflags) @@ -358,6 +362,19 @@ def configure(conf): conf.check(lib='opus', uselib_store='OPUS') # conf.check(lib='speex', uselib_store='SPEEX') + +# 'ivp/havana', +# 'ivp/havana/havok/hk_base', +# 'ivp/havana/havok/hk_math', +# 'ivp/ivp_compact_builder', +# 'ivp/ivp_physics', +# conf.check(lib='ivp_physics', uselib_store='ivp_physics') +# conf.check(lib='ivp_compactbuilder', uselib_store='ivp_compactbuilder') +# conf.check(lib='havana_constraints', uselib_store='havana_constraints') +# conf.check(lib='hk_math', uselib_store='hk_math') +# conf.check(lib='hk_base', uselib_store='hk_base') +# conf.check(lib='', uselib_store='') + if conf.env.DEST_OS != 'win32': conf.check_cc(lib='dl', mandatory=False) conf.check_cc(lib='bz2', mandatory=False)