mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-01-11 23:16:14 +01:00
Merge branch 'valgrind-variable' into 'main'
meson: Add glib_valgrind_suppressions variable to glib pkg-config file See merge request GNOME/glib!3361
This commit is contained in:
commit
9f111c3416
@ -875,18 +875,20 @@ libgio_dep = declare_dependency(link_with : libgio,
|
|||||||
|
|
||||||
pkg.generate(libgio,
|
pkg.generate(libgio,
|
||||||
requires : ['glib-2.0', 'gobject-2.0'],
|
requires : ['glib-2.0', 'gobject-2.0'],
|
||||||
variables : ['datadir=' + join_paths('${prefix}', get_option('datadir')),
|
variables : [
|
||||||
'schemasdir=' + join_paths('${datadir}', schemas_subdir),
|
'datadir=' + '${prefix}' / get_option('datadir'),
|
||||||
'bindir=' + join_paths('${prefix}', get_option('bindir')),
|
'schemasdir=' + '${datadir}' / schemas_subdir,
|
||||||
'giomoduledir=' + pkgconfig_giomodulesdir,
|
'bindir=' + '${prefix}' / get_option('bindir'),
|
||||||
'gio=' + join_paths('${bindir}', 'gio'),
|
'giomoduledir=' + pkgconfig_giomodulesdir,
|
||||||
'gio_querymodules=@0@'.format(pkgconfig_multiarch_bindir / 'gio-querymodules'),
|
'gio=' + '${bindir}' / 'gio',
|
||||||
'glib_compile_schemas=@0@'.format(pkgconfig_multiarch_bindir / 'glib-compile-schemas'),
|
'gio_querymodules=' + pkgconfig_multiarch_bindir / 'gio-querymodules',
|
||||||
'glib_compile_resources=' + join_paths('${bindir}', 'glib-compile-resources'),
|
'glib_compile_schemas=' + pkgconfig_multiarch_bindir / 'glib-compile-schemas',
|
||||||
'gdbus=' + join_paths('${bindir}', 'gdbus'),
|
'glib_compile_resources=' + '${bindir}' / 'glib-compile-resources',
|
||||||
'gdbus_codegen=' + join_paths('${bindir}', 'gdbus-codegen'),
|
'gdbus=' + '${bindir}' /'gdbus',
|
||||||
'gresource=' + join_paths('${bindir}', 'gresource'),
|
'gdbus_codegen=' + '${bindir}' / 'gdbus-codegen',
|
||||||
'gsettings=' + join_paths('${bindir}', 'gsettings')],
|
'gresource=' + '${bindir}' / 'gresource',
|
||||||
|
'gsettings=' + '${bindir}' / 'gsettings',
|
||||||
|
],
|
||||||
version : glib_version,
|
version : glib_version,
|
||||||
install_dir : glib_pkgconfigreldir,
|
install_dir : glib_pkgconfigreldir,
|
||||||
filebase : 'gio-2.0',
|
filebase : 'gio-2.0',
|
||||||
|
@ -1096,4 +1096,72 @@ if installed_tests_enabled
|
|||||||
)
|
)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
if have_bash and have_pkg_config
|
||||||
|
prefix = get_option('prefix')
|
||||||
|
if prefix.endswith(':/')
|
||||||
|
prefix += '/'
|
||||||
|
endif
|
||||||
|
|
||||||
|
pkg_config_tests = [
|
||||||
|
'pkg-config --validate gio-2.0',
|
||||||
|
'test "$(pkg-config --modversion gio-2.0)" = "@0@"'.format(glib_version),
|
||||||
|
'test "$(pkg-config --variable=prefix gio-2.0)" = "@0@"'.format(
|
||||||
|
get_option('prefix')),
|
||||||
|
'test "$(pkg-config --variable=datadir gio-2.0)" = "@0@"'.format(
|
||||||
|
prefix / get_option('datadir')),
|
||||||
|
'test "$(pkg-config --variable=schemasdir gio-2.0)" = "@0@"'.format(
|
||||||
|
prefix / get_option('datadir') / schemas_subdir),
|
||||||
|
'test "$(pkg-config --variable=giomoduledir gio-2.0)" = "@0@"'.format(
|
||||||
|
get_option('gio_module_dir') != '' ?
|
||||||
|
prefix / get_option('gio_module_dir') :
|
||||||
|
prefix / get_option('libdir') / 'gio' / 'modules'),
|
||||||
|
]
|
||||||
|
|
||||||
|
gio_binaries = [
|
||||||
|
'gio',
|
||||||
|
'gio-querymodules',
|
||||||
|
'glib-compile-schemas',
|
||||||
|
'glib-compile-resources',
|
||||||
|
'gdbus',
|
||||||
|
'gdbus-codegen',
|
||||||
|
'gresource',
|
||||||
|
'gsettings',
|
||||||
|
]
|
||||||
|
|
||||||
|
foreach binary: gio_binaries
|
||||||
|
pkg_config_tests += [
|
||||||
|
'test "$(pkg-config --variable=@0@ gio-2.0)" = "@1@"'.format(
|
||||||
|
binary.underscorify(),
|
||||||
|
prefix / get_option('bindir') / binary)
|
||||||
|
]
|
||||||
|
endforeach
|
||||||
|
|
||||||
|
test('gio-2.0-pkg-config',
|
||||||
|
bash,
|
||||||
|
args: [ '-xe', '-c', '\n'.join(pkg_config_tests) ],
|
||||||
|
suite: ['gio', 'no-valgrind', 'pkg-config'],
|
||||||
|
env: {
|
||||||
|
'PKG_CONFIG_PATH': meson.project_build_root() / 'meson-private',
|
||||||
|
},
|
||||||
|
)
|
||||||
|
|
||||||
|
platform_module = host_system == 'windows' ? 'gio-windows-2.0' : 'gio-unix-2.0'
|
||||||
|
pkg_config_tests = [
|
||||||
|
'pkg-config --validate ' + platform_module,
|
||||||
|
'test "$(pkg-config --modversion @0@)" = "@1@"'.format(platform_module,
|
||||||
|
glib_version),
|
||||||
|
'test "$(pkg-config --variable=prefix @0@)" = "@1@"'.format(platform_module,
|
||||||
|
get_option('prefix')),
|
||||||
|
]
|
||||||
|
|
||||||
|
test(platform_module + '-pkg-config',
|
||||||
|
bash,
|
||||||
|
args: [ '-xe', '-c', '\n'.join(pkg_config_tests) ],
|
||||||
|
suite: ['gio', 'no-valgrind', 'pkg-config'],
|
||||||
|
env: {
|
||||||
|
'PKG_CONFIG_PATH': meson.project_build_root() / 'meson-private',
|
||||||
|
},
|
||||||
|
)
|
||||||
|
endif
|
||||||
|
|
||||||
subdir('services')
|
subdir('services')
|
||||||
|
@ -444,10 +444,16 @@ pkg.generate(libglib,
|
|||||||
libraries_private : [win32_ldflags],
|
libraries_private : [win32_ldflags],
|
||||||
subdirs : ['glib-2.0'],
|
subdirs : ['glib-2.0'],
|
||||||
extra_cflags : ['-I${libdir}/glib-2.0/include'] + win32_cflags,
|
extra_cflags : ['-I${libdir}/glib-2.0/include'] + win32_cflags,
|
||||||
variables : ['bindir=' + join_paths('${prefix}', get_option('bindir')),
|
variables : [
|
||||||
'glib_genmarshal=' + join_paths('${bindir}', 'glib-genmarshal'),
|
'bindir=' + '${prefix}' / get_option('bindir'),
|
||||||
'gobject_query=' + join_paths('${bindir}', 'gobject-query'),
|
'datadir=' + '${prefix}' / get_option('datadir'),
|
||||||
'glib_mkenums=' + join_paths('${bindir}', 'glib-mkenums')],
|
'glib_genmarshal=' + '${bindir}' / 'glib-genmarshal',
|
||||||
|
'gobject_query=' + '${bindir}' / 'gobject-query',
|
||||||
|
'glib_mkenums=' + '${bindir}' / 'glib-mkenums',
|
||||||
|
'glib_valgrind_suppressions=' + '${datadir}' /
|
||||||
|
valgrind_suppression_file_install_subdir /
|
||||||
|
fs.name(valgrind_suppression_file),
|
||||||
|
],
|
||||||
version : glib_version,
|
version : glib_version,
|
||||||
install_dir : glib_pkgconfigreldir,
|
install_dir : glib_pkgconfigreldir,
|
||||||
filebase : 'glib-2.0',
|
filebase : 'glib-2.0',
|
||||||
|
@ -491,3 +491,34 @@ if not meson.is_cross_build() and host_system != 'windows'
|
|||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
if have_bash and have_pkg_config
|
||||||
|
prefix = get_option('prefix')
|
||||||
|
if prefix.endswith(':/')
|
||||||
|
prefix += '/'
|
||||||
|
endif
|
||||||
|
test('glib-2.0-pkg-config',
|
||||||
|
bash,
|
||||||
|
args: [
|
||||||
|
'-xe', '-c',
|
||||||
|
'\n'.join([
|
||||||
|
'pkg-config --validate glib-2.0',
|
||||||
|
'test "$(pkg-config --modversion glib-2.0)" = "@0@"'.format(glib_version),
|
||||||
|
'test "$(pkg-config --variable=prefix glib-2.0)" = "@0@"'.format(
|
||||||
|
get_option('prefix')),
|
||||||
|
'test "$(pkg-config --variable=datadir glib-2.0)" = "@0@"'.format(
|
||||||
|
prefix / get_option('datadir')),
|
||||||
|
'test "$(pkg-config --variable=gobject_query glib-2.0)" = "@0@"'.format(
|
||||||
|
prefix / get_option('bindir') / 'gobject-query'),
|
||||||
|
'test "$(pkg-config --variable=glib_mkenums glib-2.0)" = "@0@"'.format(
|
||||||
|
prefix / get_option('bindir') / 'glib-mkenums'),
|
||||||
|
'test "$(pkg-config --variable=glib_valgrind_suppressions glib-2.0)" = "@0@"'.format(
|
||||||
|
prefix / get_option('datadir') /
|
||||||
|
valgrind_suppression_file_install_subdir / fs.name(valgrind_suppression_file)),
|
||||||
|
]),
|
||||||
|
],
|
||||||
|
suite: ['glib', 'core', 'no-valgrind', 'pkg-config'],
|
||||||
|
env: {
|
||||||
|
'PKG_CONFIG_PATH': meson.project_build_root() / 'meson-private',
|
||||||
|
},
|
||||||
|
)
|
||||||
|
endif
|
||||||
|
@ -124,3 +124,31 @@ foreach test_name, extra_args : gmodule_tests
|
|||||||
suite : suite,
|
suite : suite,
|
||||||
)
|
)
|
||||||
endforeach
|
endforeach
|
||||||
|
|
||||||
|
if have_bash and have_pkg_config
|
||||||
|
modules = [
|
||||||
|
'gmodule-no-export-2.0',
|
||||||
|
'gmodule-export-2.0',
|
||||||
|
'gmodule-2.0',
|
||||||
|
]
|
||||||
|
|
||||||
|
foreach module: modules
|
||||||
|
test(module + '-pkg-config',
|
||||||
|
bash,
|
||||||
|
args: [
|
||||||
|
'-xe', '-c',
|
||||||
|
'\n'.join([
|
||||||
|
'pkg-config --validate ' + module,
|
||||||
|
'test "$(pkg-config --modversion @0@)" = "@1@"'.format(
|
||||||
|
module, glib_version),
|
||||||
|
'test "$(pkg-config --variable=prefix @0@)" = "@1@"'.format(
|
||||||
|
module, get_option('prefix')),
|
||||||
|
]),
|
||||||
|
],
|
||||||
|
suite: ['gmodule', 'no-valgrind', 'pkg-config'],
|
||||||
|
env: {
|
||||||
|
'PKG_CONFIG_PATH': meson.project_build_root() / 'meson-private',
|
||||||
|
},
|
||||||
|
)
|
||||||
|
endforeach
|
||||||
|
endif
|
||||||
|
@ -52,3 +52,22 @@ foreach test_name, extra_args : gthread_tests
|
|||||||
suite : suite,
|
suite : suite,
|
||||||
)
|
)
|
||||||
endforeach
|
endforeach
|
||||||
|
|
||||||
|
if have_bash and have_pkg_config
|
||||||
|
test('gthread-2.0-pkg-config',
|
||||||
|
bash,
|
||||||
|
args: [
|
||||||
|
'-xe', '-c',
|
||||||
|
'\n'.join([
|
||||||
|
'pkg-config --validate gthread-2.0',
|
||||||
|
'test "$(pkg-config --modversion gthread-2.0)" = "@0@"'.format(glib_version),
|
||||||
|
'test "$(pkg-config --variable=prefix gthread-2.0)" = "@0@"'.format(
|
||||||
|
get_option('prefix')),
|
||||||
|
]),
|
||||||
|
],
|
||||||
|
suite: ['gthread', 'no-valgrind', 'pkg-config'],
|
||||||
|
env: {
|
||||||
|
'PKG_CONFIG_PATH': meson.project_build_root() / 'meson-private',
|
||||||
|
},
|
||||||
|
)
|
||||||
|
endif
|
||||||
|
13
meson.build
13
meson.build
@ -9,6 +9,8 @@ project('glib', 'c',
|
|||||||
]
|
]
|
||||||
)
|
)
|
||||||
|
|
||||||
|
fs = import('fs')
|
||||||
|
|
||||||
cc = meson.get_compiler('c')
|
cc = meson.get_compiler('c')
|
||||||
c_standards = {}
|
c_standards = {}
|
||||||
|
|
||||||
@ -175,9 +177,10 @@ add_test_setup('unstable_tests',
|
|||||||
|
|
||||||
# Allow the tests to be easily run under valgrind using --setup=valgrind
|
# Allow the tests to be easily run under valgrind using --setup=valgrind
|
||||||
valgrind = find_program('valgrind', required: false)
|
valgrind = find_program('valgrind', required: false)
|
||||||
if valgrind.found()
|
valgrind_suppression_file = files('tools' / 'glib.supp')[0]
|
||||||
suppression_file = files('tools' / 'glib.supp')
|
valgrind_suppression_file_install_subdir = 'glib-2.0' / 'valgrind'
|
||||||
|
|
||||||
|
if valgrind.found()
|
||||||
add_test_setup('valgrind',
|
add_test_setup('valgrind',
|
||||||
exclude_suites: [ 'no-valgrind', 'flaky' ],
|
exclude_suites: [ 'no-valgrind', 'flaky' ],
|
||||||
exe_wrapper: [
|
exe_wrapper: [
|
||||||
@ -191,7 +194,7 @@ if valgrind.found()
|
|||||||
'--show-leak-kinds=definite,possible',
|
'--show-leak-kinds=definite,possible',
|
||||||
'--show-error-list=yes',
|
'--show-error-list=yes',
|
||||||
'--suppressions=@0@'.format(meson.project_source_root() /
|
'--suppressions=@0@'.format(meson.project_source_root() /
|
||||||
'@0@'.format(suppression_file[0])),
|
'@0@'.format(valgrind_suppression_file)),
|
||||||
],
|
],
|
||||||
env: common_test_env,
|
env: common_test_env,
|
||||||
timeout_multiplier: 20,
|
timeout_multiplier: 20,
|
||||||
@ -2285,9 +2288,11 @@ if not python_version.version_compare(python_version_req)
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
# Determine which user environment-dependent files that we want to install
|
# Determine which user environment-dependent files that we want to install
|
||||||
have_bash = find_program('bash', required : false).found() # For completion scripts
|
bash = find_program('bash', required : false)
|
||||||
|
have_bash = bash.found() # For completion scripts
|
||||||
bash_comp_dep = dependency('bash-completion', version: '>=2.0', required: false)
|
bash_comp_dep = dependency('bash-completion', version: '>=2.0', required: false)
|
||||||
have_sh = find_program('sh', required : false).found() # For glib-gettextize
|
have_sh = find_program('sh', required : false).found() # For glib-gettextize
|
||||||
|
have_pkg_config = find_program('pkg-config', required: false).found()
|
||||||
|
|
||||||
# Some installed tests require a custom environment
|
# Some installed tests require a custom environment
|
||||||
env_program = find_program('env', required: installed_tests_enabled)
|
env_program = find_program('env', required: installed_tests_enabled)
|
||||||
|
@ -17,8 +17,8 @@ endif
|
|||||||
if host_system != 'windows'
|
if host_system != 'windows'
|
||||||
# Install Valgrind suppression file (except on Windows,
|
# Install Valgrind suppression file (except on Windows,
|
||||||
# as Valgrind is currently not supported on Windows)
|
# as Valgrind is currently not supported on Windows)
|
||||||
install_data('glib.supp',
|
install_data(fs.name(valgrind_suppression_file),
|
||||||
install_dir : get_option('datadir') / 'glib-2.0' / 'valgrind',
|
install_dir : get_option('datadir') / valgrind_suppression_file_install_subdir,
|
||||||
install_tag : 'devel',
|
install_tag : 'devel',
|
||||||
)
|
)
|
||||||
endif
|
endif
|
||||||
|
Loading…
Reference in New Issue
Block a user