gio, gmodule, gthread: compile windows resources only in shared build

When linking static libraries, multiple resources is an error unless
handled in a special way. glib and gobject do not have this problem,
as they already only include resources when building a shared lib.
This commit is contained in:
Hailey Somerville 2024-01-21 17:35:55 +11:00
parent 75310f658d
commit c65e163240
3 changed files with 11 additions and 9 deletions

View File

@ -458,13 +458,15 @@ else
'gwin32sid.h', 'gwin32sid.h',
) )
gio_win_rc = configure_file( if glib_build_shared
input: 'gio.rc.in', gio_win_rc = configure_file(
output: 'gio.rc', input: 'gio.rc.in',
configuration: glibconfig_conf, output: 'gio.rc',
) configuration: glibconfig_conf,
gio_win_res = windows.compile_resources(gio_win_rc) )
win32_sources += [gio_win_res] gio_win_res = windows.compile_resources(gio_win_rc)
win32_sources += [gio_win_res]
endif
gio_win32_include_headers = files( gio_win32_include_headers = files(
'gregistrysettingsbackend.h', 'gregistrysettingsbackend.h',

View File

@ -80,7 +80,7 @@ gmodule_visibility_h = custom_target(
gmodule_sources = [gmodule_c, gmodule_visibility_h, gmodule_deprecated_c] gmodule_sources = [gmodule_c, gmodule_visibility_h, gmodule_deprecated_c]
if host_system == 'windows' if host_system == 'windows' and glib_build_shared
gmodule_win_rc = configure_file( gmodule_win_rc = configure_file(
input: 'gmodule.rc.in', input: 'gmodule.rc.in',
output: 'gmodule.rc', output: 'gmodule.rc',

View File

@ -2,7 +2,7 @@
# has been moved into glib now # has been moved into glib now
gthread_sources = ['gthread-impl.c'] gthread_sources = ['gthread-impl.c']
if host_system == 'windows' if host_system == 'windows' and glib_build_shared
gthread_win_rc = configure_file( gthread_win_rc = configure_file(
input: 'gthread.rc.in', input: 'gthread.rc.in',
output: 'gthread.rc', output: 'gthread.rc',