build: Define the preload variable name and separator globally

We may need this in multiple tests, so let's share the value
This commit is contained in:
Marco Trevisan (Treviño) 2024-05-09 21:01:50 +02:00
parent 0e97aade66
commit ab2e68cf75
3 changed files with 12 additions and 10 deletions

View File

@ -328,11 +328,11 @@ if host_machine.system() != 'windows'
'gsocketclient-slow' : {
'depends' : slow_connect_preload_lib,
'env' : {
'LD_PRELOAD': slow_connect_preload_lib.full_path(),
glib_exec_var_preload: slow_connect_preload_lib.full_path(),
} + asan_env,
'installed_tests_env' : {
} + asan_env,
'LD_PRELOAD': installed_tests_execdir /
glib_exec_var_preload: installed_tests_execdir /
fs.name(slow_connect_preload_lib.full_path()),
},
}

View File

@ -259,12 +259,6 @@ else
install_tag : 'tests',
install: installed_tests_enabled)
if host_system not in ['ios', 'darwin']
var_preload = 'LD_PRELOAD'
else
var_preload = 'DYLD_INSERT_LIBRARIES'
endif
asan_env = {}
if 'address' in glib_sanitizers
asan_env = {'ASAN_OPTIONS': 'verify_asan_link_order=0'}
@ -274,10 +268,10 @@ else
'gutils-user-database' : {
'depends' : getpwuid_preload,
'env' : {
var_preload: getpwuid_preload.full_path()
glib_exec_var_preload: getpwuid_preload.full_path()
} + asan_env,
'installed_tests_env' : {
var_preload: installed_tests_execdir / fs.name(getpwuid_preload.full_path())
glib_exec_var_preload: installed_tests_execdir / fs.name(getpwuid_preload.full_path())
} + asan_env,
},
}

View File

@ -2603,6 +2603,14 @@ gir_args = [
'--quiet',
]
if host_system in ['ios', 'darwin']
glib_exec_var_preload = 'DYLD_INSERT_LIBRARIES'
glib_exec_var_preload_separator = ':'
else
glib_exec_var_preload = 'LD_PRELOAD'
glib_exec_var_preload_separator = ' '
endif
pkg = import('pkgconfig')
windows = import('windows')
gnome = import('gnome')