diff --git a/gio/tests/meson.build b/gio/tests/meson.build index 92e09a494..e7fa812c4 100644 --- a/gio/tests/meson.build +++ b/gio/tests/meson.build @@ -227,7 +227,7 @@ if host_machine.system() != 'windows' } # LD_PRELOAD modules don't work so well with AddressSanitizer - if have_rtld_next and get_option('b_sanitize') == 'none' + if have_rtld_next and get_option('default_library') != 'static' and get_option('b_sanitize') == 'none' gio_tests += { 'gsocketclient-slow' : { 'depends' : [ @@ -656,25 +656,27 @@ if meson.can_run_host_binaries() compiler_type = '--compiler=@0@'.format(cc.get_id()) - plugin_resources_c = custom_target('plugin-resources.c', - input : 'test4.gresource.xml', - output : 'plugin-resources.c', - command : [glib_compile_resources, - compiler_type, - '--target=@OUTPUT@', - '--sourcedir=' + meson.current_source_dir(), - '--internal', - '--generate-source', - '--c-name', '_g_plugin', - '@INPUT@']) + if get_option('default_library') != 'static' + plugin_resources_c = custom_target('plugin-resources.c', + input : 'test4.gresource.xml', + output : 'plugin-resources.c', + command : [glib_compile_resources, + compiler_type, + '--target=@OUTPUT@', + '--sourcedir=' + meson.current_source_dir(), + '--internal', + '--generate-source', + '--c-name', '_g_plugin', + '@INPUT@']) - shared_module('resourceplugin', 'resourceplugin.c', plugin_resources_c, - link_args : export_dynamic_ldflags, - dependencies : common_gio_tests_deps, - install_dir : installed_tests_execdir, - install_tag : 'tests', - install : installed_tests_enabled - ) + shared_module('resourceplugin', 'resourceplugin.c', plugin_resources_c, + link_args : export_dynamic_ldflags, + dependencies : common_gio_tests_deps, + install_dir : installed_tests_execdir, + install_tag : 'tests', + install : installed_tests_enabled + ) + endif # referenced by test2.gresource.xml big_test_resource = custom_target( @@ -976,4 +978,7 @@ if installed_tests_enabled endif subdir('services') -subdir('modules') + +if get_option('default_library') != 'static' + subdir('modules') +endif diff --git a/glib/tests/meson.build b/glib/tests/meson.build index e8f637445..db01b54b4 100644 --- a/glib/tests/meson.build +++ b/glib/tests/meson.build @@ -204,7 +204,7 @@ else 'include' : {}, 'unix' : {}, } - if have_rtld_next + if have_rtld_next and get_option('default_library') != 'static' glib_tests += { 'gutils-user-database' : { 'depends' : [ diff --git a/gmodule/tests/meson.build b/gmodule/tests/meson.build index db7232b49..3968c4326 100644 --- a/gmodule/tests/meson.build +++ b/gmodule/tests/meson.build @@ -37,22 +37,24 @@ if ['darwin', 'ios'].contains(host_machine.system()) module_suffix = 'so' endif -foreach module : ['moduletestplugin_a', 'moduletestplugin_b'] - shared_module(module + '_plugin', 'lib@0@.c'.format(module), - dependencies : [libglib_dep, libgmodule_dep], - install_dir : installed_tests_execdir, - install_tag : 'tests', - install : installed_tests_enabled, - name_suffix : module_suffix - ) - shared_library(module + '_library', 'lib@0@.c'.format(module), - dependencies : [libglib_dep, libgmodule_dep], - install_dir : installed_tests_execdir, - install_tag : 'tests', - install : installed_tests_enabled, - name_suffix : module_suffix - ) -endforeach +if get_option('default_library') != 'static' + foreach module : ['moduletestplugin_a', 'moduletestplugin_b'] + shared_module(module + '_plugin', 'lib@0@.c'.format(module), + dependencies : [libglib_dep, libgmodule_dep], + install_dir : installed_tests_execdir, + install_tag : 'tests', + install : installed_tests_enabled, + name_suffix : module_suffix + ) + shared_library(module + '_library', 'lib@0@.c'.format(module), + dependencies : [libglib_dep, libgmodule_dep], + install_dir : installed_tests_execdir, + install_tag : 'tests', + install : installed_tests_enabled, + name_suffix : module_suffix + ) + endforeach +endif test_env = environment() test_env.set('G_TEST_SRCDIR', meson.current_source_dir())