mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-08-31 13:24:13 +02:00
meson: Build C++ tests for the currently supported C++ standard versions
We've various macros definitions that are depending using C++ features that may not work in all the standard versions, so recompile the cxx tests that we have in all the ones we want to support.
This commit is contained in:
@@ -15,8 +15,19 @@ if have_cxx
|
||||
gmodule_tests += {
|
||||
'cxx' : {
|
||||
'source' : ['cxx.cpp'],
|
||||
'suite' : ['cpp'],
|
||||
}
|
||||
}
|
||||
|
||||
foreach std, arg: cxx_standards
|
||||
gmodule_tests += {
|
||||
'cxx-@0@'.format(std) : {
|
||||
'source' : ['cxx.cpp'],
|
||||
'suite' : ['cpp'],
|
||||
'cpp_args' : [arg],
|
||||
},
|
||||
}
|
||||
endforeach
|
||||
endif
|
||||
|
||||
module_suffix = []
|
||||
@@ -49,6 +60,7 @@ test_env.set('MALLOC_CHECK_', '2')
|
||||
|
||||
test_deps = [libm, thread_dep, libglib_dep, libgmodule_dep]
|
||||
test_cargs = ['-DG_LOG_DOMAIN="GModule"', '-UG_DISABLE_ASSERT']
|
||||
test_cpp_args = test_cargs
|
||||
|
||||
foreach test_name, extra_args : gmodule_tests
|
||||
source = extra_args.get('source', test_name + '.c')
|
||||
@@ -69,6 +81,7 @@ foreach test_name, extra_args : gmodule_tests
|
||||
|
||||
exe = executable(test_name, source,
|
||||
c_args : test_cargs + extra_args.get('c_args', []),
|
||||
cpp_args : test_cpp_args + extra_args.get('cpp_args', []),
|
||||
link_args : extra_args.get('link_args', []),
|
||||
dependencies : test_deps + extra_args.get('dependencies', []),
|
||||
export_dynamic : extra_args.get('export_dynamic', false),
|
||||
|
Reference in New Issue
Block a user