diff --git a/gio/meson.build b/gio/meson.build index b83d8f5f3..04581b1cc 100644 --- a/gio/meson.build +++ b/gio/meson.build @@ -979,7 +979,4 @@ if enable_systemtap endif subdir('fam') - -if host_system != 'windows' - subdir('tests') -endif +subdir('tests') diff --git a/gio/tests/g-file-info.c b/gio/tests/g-file-info.c index 112502606..28a2426a8 100644 --- a/gio/tests/g-file-info.c +++ b/gio/tests/g-file-info.c @@ -29,8 +29,9 @@ #ifdef G_OS_WIN32 #include #include -#include -#include +#include +#include +#include /* for _get_osfhandle */ #endif #define TEST_NAME "Prilis zlutoucky kun" diff --git a/gio/tests/gdbus-serialization.c b/gio/tests/gdbus-serialization.c index d2f0a6ce7..2ab856c48 100644 --- a/gio/tests/gdbus-serialization.c +++ b/gio/tests/gdbus-serialization.c @@ -22,7 +22,9 @@ #include #include +#ifndef _MSC_VER #include +#endif #include /* ---------------------------------------------------------------------------------------------------- */ diff --git a/gio/tests/gdbus-tests.c b/gio/tests/gdbus-tests.c index 0655f1be4..35e379bd2 100644 --- a/gio/tests/gdbus-tests.c +++ b/gio/tests/gdbus-tests.c @@ -19,7 +19,9 @@ */ #include +#ifndef _MSC_VER #include +#endif #include "gdbus-tests.h" diff --git a/gio/tests/meson.build b/gio/tests/meson.build index 2b9eada24..e16f53466 100644 --- a/gio/tests/meson.build +++ b/gio/tests/meson.build @@ -5,6 +5,10 @@ common_gio_tests_deps = [ libgio_dep, ] +if host_machine.system() == 'windows' + common_gio_tests_deps += [iphlpapi_dep, winsock2, cc.find_library ('secur32')] +endif + subdir('gdbus-object-manager-example') gengiotypefuncs_prog = find_program('gengiotypefuncs.py') @@ -321,22 +325,27 @@ test_extra_programs += [{ 'extra_sources' : ['gtlsconsoleinteraction.c'], 'install' : false, }, - # These three are manual-run tests because they need a session bus but don't bring one up themselves - # FIXME: these build but don't seem to work! - 'gdbus-example-objectmanager-client' : { - 'dependencies' : [libgdbus_example_objectmanager_dep], - 'install' : false, - }, - 'gdbus-example-objectmanager-server' : { - 'dependencies' : [libgdbus_example_objectmanager_dep], - 'install' : false, - }, - 'gdbus-test-fixture' : { - 'dependencies' : [libgdbus_example_objectmanager_dep], - 'install' : false, - }, }] +if cc.get_id() != 'msvc' + test_extra_programs += [{ + # These three are manual-run tests because they need a session bus but don't bring one up themselves + # FIXME: these build but don't seem to work! + 'gdbus-example-objectmanager-client' : { + 'dependencies' : [libgdbus_example_objectmanager_dep], + 'install' : false, + }, + 'gdbus-example-objectmanager-server' : { + 'dependencies' : [libgdbus_example_objectmanager_dep], + 'install' : false, + }, + 'gdbus-test-fixture' : { + 'dependencies' : [libgdbus_example_objectmanager_dep], + 'install' : false, + }, + }] +endif + if host_machine.system() != 'windows' test_extra_programs += [{ 'gdbus-example-unix-fd-client' : { @@ -357,13 +366,8 @@ if not meson.is_cross_build() or meson.has_exe_wrapper() '--c-name', '_g_plugin', '@INPUT@']) - if host_system == 'windows' - resource_plugin_platform_link_args = ['-no-undefined'] - else - resource_plugin_platform_link_args = [] - endif shared_module ('resourceplugin', 'resourceplugin.c', plugin_resources_c, - link_args : export_dynamic_ldflags + resource_plugin_platform_link_args, + link_args : export_dynamic_ldflags, dependencies : common_gio_tests_deps) test_gresource = custom_target('test.gresource', diff --git a/gio/tests/modules/test-module-a.c b/gio/tests/modules/test-module-a.c index 6ac065d8a..0a64ea60a 100644 --- a/gio/tests/modules/test-module-a.c +++ b/gio/tests/modules/test-module-a.c @@ -20,6 +20,8 @@ * if advised of the possibility of such damage. */ +#include "config.h" /* for _GLIB_EXTERN */ + #include #include "symbol-visibility.h" diff --git a/gio/tests/modules/test-module-b.c b/gio/tests/modules/test-module-b.c index 21932287f..8d3527e43 100644 --- a/gio/tests/modules/test-module-b.c +++ b/gio/tests/modules/test-module-b.c @@ -20,6 +20,8 @@ * if advised of the possibility of such damage. */ +#include "config.h" /* for _GLIB_EXTERN */ + #include #include "symbol-visibility.h" diff --git a/gio/tests/readwrite.c b/gio/tests/readwrite.c index 9f674c39d..2aa925b30 100644 --- a/gio/tests/readwrite.c +++ b/gio/tests/readwrite.c @@ -6,6 +6,9 @@ #ifdef G_OS_UNIX #include #endif +#ifdef G_OS_WIN32 +#include /* for close() */ +#endif static const char *original_data = "This is some test data that we can put in a file..."; static const char *new_data = "new data..";