mirror of
https://github.com/brl/mutter.git
synced 2024-11-28 19:10:43 -05:00
build: Harmonize c_args handling
The slightly different styles in the different build files make it harder to reason about or share c_args. This notably ensures we never set any extra c_args for plain builds and fixes the cc.get_supported_arguments() check in Cogl, Clutter and Mtk. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3333>
This commit is contained in:
parent
aaa63c1e08
commit
ee65ca791b
@ -12,18 +12,20 @@ clutter_c_args = [
|
||||
]
|
||||
|
||||
clutter_debug_c_args = []
|
||||
if buildtype != 'plain'
|
||||
if get_option('debug')
|
||||
clutter_debug_c_args += [
|
||||
'-DCLUTTER_ENABLE_DEBUG',
|
||||
'-fno-omit-frame-pointer'
|
||||
'-fno-omit-frame-pointer',
|
||||
]
|
||||
elif buildtype != 'plain'
|
||||
else
|
||||
clutter_debug_c_args += [
|
||||
'-DG_DISABLE_ASSERT',
|
||||
'-DG_DISABLE_CAST_CHECKS',
|
||||
]
|
||||
endif
|
||||
supported_clutter_debug_c_args = cc.get_supported_arguments(clutter_debug_c_args)
|
||||
endif
|
||||
clutter_debug_c_args = cc.get_supported_arguments(clutter_debug_c_args)
|
||||
clutter_c_args += clutter_debug_c_args
|
||||
|
||||
clutter_pkg_deps = [
|
||||
|
@ -84,20 +84,21 @@ if have_gles2
|
||||
endif
|
||||
|
||||
cogl_debug_c_args = []
|
||||
buildtype = get_option('buildtype')
|
||||
if buildtype != 'plain'
|
||||
if get_option('debug')
|
||||
cogl_debug_c_args += [
|
||||
'-DCOGL_GL_DEBUG',
|
||||
'-DCOGL_OBJECT_DEBUG',
|
||||
'-DCOGL_ENABLE_DEBUG',
|
||||
'-fno-omit-frame-pointer'
|
||||
'-fno-omit-frame-pointer',
|
||||
]
|
||||
elif buildtype != 'plain'
|
||||
else
|
||||
cogl_debug_c_args += [
|
||||
'-DG_DISABLE_CAST_CHECKS'
|
||||
'-DG_DISABLE_CAST_CHECKS',
|
||||
]
|
||||
endif
|
||||
supported_cogl_debug_c_args = cc.get_supported_arguments(cogl_debug_c_args)
|
||||
endif
|
||||
cogl_debug_c_args = cc.get_supported_arguments(cogl_debug_c_args)
|
||||
cogl_c_args += cogl_debug_c_args
|
||||
|
||||
subdir('cogl')
|
||||
|
15
meson.build
15
meson.build
@ -466,7 +466,7 @@ add_project_arguments('-D_GNU_SOURCE', language: 'c')
|
||||
|
||||
buildtype = get_option('buildtype')
|
||||
if buildtype != 'plain'
|
||||
all_warnings = [
|
||||
mutter_c_args = [
|
||||
'-fno-strict-aliasing',
|
||||
'-Wpointer-arith',
|
||||
'-Wmissing-declarations',
|
||||
@ -506,17 +506,16 @@ if buildtype != 'plain'
|
||||
'-Wno-missing-field-initializers',
|
||||
'-Wno-type-limits',
|
||||
]
|
||||
supported_warnings = cc.get_supported_arguments(all_warnings)
|
||||
add_project_arguments(supported_warnings, language: 'c')
|
||||
endif
|
||||
|
||||
if get_option('debug')
|
||||
debug_c_args = [
|
||||
mutter_c_args += [
|
||||
'-DG_ENABLE_DEBUG',
|
||||
'-fno-omit-frame-pointer'
|
||||
'-fno-omit-frame-pointer',
|
||||
]
|
||||
supported_debug_c_args = cc.get_supported_arguments(debug_c_args)
|
||||
add_project_arguments(supported_debug_c_args, language: 'c')
|
||||
endif
|
||||
|
||||
supported_mutter_c_args = cc.get_supported_arguments(mutter_c_args)
|
||||
add_project_arguments(supported_mutter_c_args, language: 'c')
|
||||
endif
|
||||
|
||||
cc.compiles('void main (void) { __builtin_ffsl (0); __builtin_popcountl (0); }')
|
||||
|
@ -14,17 +14,19 @@ mtk_c_args = [
|
||||
]
|
||||
|
||||
mtk_debug_c_args = []
|
||||
if buildtype != 'plain'
|
||||
if get_option('debug')
|
||||
mtk_debug_c_args += [
|
||||
'-fno-omit-frame-pointer'
|
||||
]
|
||||
elif buildtype != 'plain'
|
||||
else
|
||||
mtk_debug_c_args += [
|
||||
'-DG_DISABLE_ASSERT',
|
||||
'-DG_DISABLE_CAST_CHECKS',
|
||||
]
|
||||
endif
|
||||
supported_mtk_debug_c_args = cc.get_supported_arguments(mtk_debug_c_args)
|
||||
endif
|
||||
mtk_debug_c_args = cc.get_supported_arguments(mtk_debug_c_args)
|
||||
mtk_c_args += mtk_debug_c_args
|
||||
|
||||
mtk_pkg_deps = [
|
||||
|
Loading…
Reference in New Issue
Block a user