mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-08-01 15:03:39 +02:00
Fix module tests on Visual Studio builds
On Visual Studio, Meson builds modules as xxxx.dll, not libxxxx.dll when xxxx is specified as the name for the shared_module() build directive. This means that in the test programs if we expect for libxxxx for the module name, the test will fail as there is no libxxxx.dll but there is xxxx.dll. This makes the test program look for the module files correctly.
This commit is contained in:
@@ -28,6 +28,12 @@
|
||||
#include <gmodule.h>
|
||||
#include <string.h>
|
||||
|
||||
#ifdef _MSC_VER
|
||||
# define MODULE_FILENAME_PREFIX ""
|
||||
#else
|
||||
# define MODULE_FILENAME_PREFIX "lib"
|
||||
#endif
|
||||
|
||||
gchar* global_state;
|
||||
|
||||
G_MODULE_EXPORT void g_clash_func (void);
|
||||
@@ -84,8 +90,8 @@ main (int argc,
|
||||
if (!g_module_supported ())
|
||||
g_error ("dynamic modules not supported");
|
||||
|
||||
plugin_a = g_test_build_filename (G_TEST_BUILT, "libmoduletestplugin_a", NULL);
|
||||
plugin_b = g_test_build_filename (G_TEST_BUILT, "libmoduletestplugin_b", NULL);
|
||||
plugin_a = g_test_build_filename (G_TEST_BUILT, MODULE_FILENAME_PREFIX "moduletestplugin_a", NULL);
|
||||
plugin_b = g_test_build_filename (G_TEST_BUILT, MODULE_FILENAME_PREFIX "moduletestplugin_b", NULL);
|
||||
|
||||
/* module handles */
|
||||
|
||||
|
Reference in New Issue
Block a user