@ -114,52 +114,35 @@ inc_common = [
dep_vulkan = dependency ( 'vulkan' , required : get_option ( 'use_system_vulkan' ) )
dep_pthread = dependency ( 'threads' )
# Check for generic C arguments
c_args = [ ]
foreach a : [ '-Werror=implicit-function-declaration' ,
'-Werror=missing-prototypes' , '-Werror=return-type' ,
'-Werror=incompatible-pointer-types' ,
'-Wno-unused-parameter' , '-Qunused-arguments' ,
'-fno-math-errno' , '-fno-trapping-math' ]
if cc . has_argument ( a )
c_args + = a
endif
endforeach
foreach a : [ 'missing-field-initializers' ]
if cc . has_argument ( '-W' + a )
c_args + = '-Wno-' + a
endif
endforeach
# Check for generic C++ arguments
cpp_args = [ ]
foreach a : [ '-Werror=return-type' ,
'-Wno-unused-parameter' , '-Qunused-arguments' ,
'-fno-math-errno' , '-fno-trapping-math' ]
if cpp . has_argument ( a )
cpp_args + = a
endif
endforeach
# For some reason, the test for -Wno-foo always succeeds with gcc, even if the
# option is not supported. Hence, check for -Wfoo instead.
add_project_arguments (
cc . get_supported_arguments ( [
'-Werror=implicit-function-declaration' ,
'-Werror=missing-prototypes' ,
'-Werror=return-type' ,
'-Werror=incompatible-pointer-types' ,
'-Wno-unused-parameter' ,
'-Qunused-arguments' ,
'-fno-math-errno' ,
'-fno-trapping-math' ,
'-Wno-missing-field-initializers' ,
] ) , language : [ 'c' ] ,
)
foreach a : [ 'non-virtual-dtor' , 'missing-field-initializers' , ]
if cpp . has_argument ( '-W' + a )
cpp_args + = '-Wno-' + a
endif
endforeach
add_project_arguments (
cpp . get_supported_arguments ( [
'-Werror=return-type' ,
'-Wno-unused-parameter' ,
'-Qunused-arguments' ,
'-fno-math-errno' ,
'-fno-trapping-math' ,
'-Wno-non-virtual-dtor' ,
'-Wno-missing-field-initializers' ,
] ) , language : [ 'cpp' ] ,
)
foreach a : pre_args
add_project_arguments ( a , language : [ 'c' , 'cpp' ] )
endforeach
foreach a : c_args
add_project_arguments ( a , language : [ 'c' ] )
endforeach
foreach a : cpp_args
add_project_arguments ( a , language : [ 'cpp' ] )
endforeach
# check for dl support
if is_unixy