diff --git a/gio/meson.build b/gio/meson.build index 51dc4cfae..83160734e 100644 --- a/gio/meson.build +++ b/gio/meson.build @@ -724,7 +724,7 @@ else gio_dtrace_hdr = [] endif -libgio = shared_library('gio-2.0', +libgio = library('gio-2.0', gioenumtypes_h, gioenumtypes_c, gnetworking_h, gio_sources, gio_dtrace_hdr, gio_dtrace_obj, version : library_version, diff --git a/gio/tests/gdbus-object-manager-example/meson.build b/gio/tests/gdbus-object-manager-example/meson.build index 630357378..d594c685b 100644 --- a/gio/tests/gdbus-object-manager-example/meson.build +++ b/gio/tests/gdbus-object-manager-example/meson.build @@ -14,7 +14,7 @@ gdbus_example_objectmanager_generated = custom_target('gdbus-example-objectmanag '--generate-docbook', 'gdbus-example-objectmanager-generated', '@INPUT@']) -libgdbus_example_objectmanager = shared_library('libgdbus-example-objectmanager', +libgdbus_example_objectmanager = library('libgdbus-example-objectmanager', gdbus_example_objectmanager_generated, c_args : ['-DHAVE_CONFIG_H=1'] + gio_c_args, dependencies : [libglib_dep, libgmodule_dep, libgobject_dep, libgio_dep], diff --git a/gio/tests/modules/meson.build b/gio/tests/modules/meson.build index c219015d3..5ae131ae7 100644 --- a/gio/tests/modules/meson.build +++ b/gio/tests/modules/meson.build @@ -1,10 +1,10 @@ -libtestmodulea = shared_library('testmodulea', 'test-module-a.c', +libtestmodulea = library('testmodulea', 'test-module-a.c', install : false, dependencies : [libglib_dep, libgobject_dep, libgmodule_dep, libgio_dep], c_args : [ ] ) -libtestmoduleb = shared_library('testmoduleb', 'test-module-b.c', +libtestmoduleb = library('testmoduleb', 'test-module-b.c', install : false, dependencies : [libglib_dep, libgobject_dep, libgmodule_dep, libgio_dep], c_args : [ ] diff --git a/glib/glibconfig.h.in b/glib/glibconfig.h.in index 43e1ba122..076d7ac8d 100644 --- a/glib/glibconfig.h.in +++ b/glib/glibconfig.h.in @@ -18,6 +18,9 @@ */ #mesondefine GLIB_USING_SYSTEM_PRINTF +#mesondefine GLIB_STATIC_COMPILATION +#mesondefine GOBJECT_STATIC_COMPILATION + G_BEGIN_DECLS #define G_MINFLOAT FLT_MIN @@ -115,7 +118,6 @@ typedef unsigned @glib_intptr_type_define@ guintptr; #define GLIB_MICRO_VERSION @GLIB_MICRO_VERSION@ @glib_os@ -@glib_static_compilation@ @glib_vacopy@ diff --git a/glib/meson.build b/glib/meson.build index 2b3790c0a..6bd2ec94c 100644 --- a/glib/meson.build +++ b/glib/meson.build @@ -227,7 +227,7 @@ if use_pcre_static_flag pcre_static_args = ['-DPCRE_STATIC'] endif -libglib = shared_library('glib-2.0', +libglib = library('glib-2.0', glib_dtrace_obj, glib_dtrace_hdr, sources : [deprecated_sources, glib_sources], version : library_version, diff --git a/gmodule/meson.build b/gmodule/meson.build index be1fff308..03c689e3a 100644 --- a/gmodule/meson.build +++ b/gmodule/meson.build @@ -95,7 +95,7 @@ if host_system == 'windows' gmodule_sources += [gmodule_win_res] endif -libgmodule = shared_library('gmodule-2.0', +libgmodule = library('gmodule-2.0', sources : gmodule_sources, version : library_version, soversion : soversion, diff --git a/gobject/meson.build b/gobject/meson.build index 74d352dea..f58cfb297 100644 --- a/gobject/meson.build +++ b/gobject/meson.build @@ -61,7 +61,7 @@ else gobject_dtrace_hdr = [] endif -libgobject = shared_library('gobject-2.0', +libgobject = library('gobject-2.0', gobject_dtrace_obj, gobject_dtrace_hdr, sources : gobject_sources, version : library_version, diff --git a/gthread/meson.build b/gthread/meson.build index 7d1120e73..8d4696d29 100644 --- a/gthread/meson.build +++ b/gthread/meson.build @@ -12,7 +12,7 @@ if host_system == 'windows' gthread_sources += [gthread_win_res] endif -libgthread = shared_library('gthread-2.0', +libgthread = library('gthread-2.0', sources : gthread_sources, version : library_version, soversion : soversion, diff --git a/meson.build b/meson.build index 254acac5e..2f474cc7f 100644 --- a/meson.build +++ b/meson.build @@ -123,6 +123,11 @@ if get_option('default_library') != 'static' endif endif +if host_system == 'windows' and get_option('default_library') == 'static' + glibconfig_conf.set('GLIB_STATIC_COMPILATION', '1') + glibconfig_conf.set('GOBJECT_STATIC_COMPILATION', '1') +endif + # FIXME: what about Cygwin (G_WITH_CYGWIN) if host_system == 'windows' glib_os = '''#define G_OS_WIN32