Skip to content

Commit

Permalink
Use a single 'gio_platform' dependency object
Browse files Browse the repository at this point in the history
  • Loading branch information
arteymix committed Mar 20, 2017
1 parent 95fd09d commit 936a0fd
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 7 deletions.
8 changes: 8 additions & 0 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,14 @@ gio_windows = dependency('gio-windows-2.0', version: '>=2.40', required: false)
gmodule = dependency('gmodule-2.0', version: '>=2.40')
soup = dependency('libsoup-2.4', version: '>=2.44')

if gio_unix.found()
gio_platform = gio_unix
elif gio_windows.found()
gio_platform = gio_windows
else
error('Either \'gio-unix-2.0\' or \'gio-windows-2.0\' must be available.')
endif

# provide 'OutputStream.write_all_async' and 'SimpleIOStream'
if gio.version().version_compare('>=2.44')
add_project_arguments('--define=GIO_2_44', language: 'vala')
Expand Down
2 changes: 1 addition & 1 deletion src/vsgi/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ vsgi_sources = files(
'vsgi-socket-server.vala',
'vsgi-tee-output-stream.vala')
vsgi_lib = library('vsgi-' + api_version, vsgi_sources,
dependencies: [glib, gobject, gio, gio_unix, gio_windows, gmodule, soup],
dependencies: [glib, gobject, gio, gio_platform, gmodule, soup],
vala_args: ['--pkg=posix'],
vala_header: 'vsgi.h',
install: true,
Expand Down
4 changes: 2 additions & 2 deletions src/vsgi/servers/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ shared_library('vsgi-http', ['vsgi-http.vala'],
install_dir: '@0@/vsgi-@1@/servers'.format(get_option('libdir'), api_version))

shared_library('vsgi-cgi', 'vsgi-cgi.vala',
dependencies: [glib, gobject, gio, gio_unix, gio_windows, soup, vsgi],
dependencies: [glib, gobject, gio, gio_platform, soup, vsgi],
install: true,
install_dir: '@0@/vsgi-@1@/servers'.format(get_option('libdir'), api_version))

fcgi = meson.get_compiler('c').find_library('fcgi', required: false)
if fcgi.found()
fcgi_vapi = meson.get_compiler('vala').find_library('fcgi', dirs: meson.current_source_dir())
shared_library('vsgi-fastcgi', 'vsgi-fastcgi.vala',
dependencies: [glib, gobject, gio, gio_unix, gio_windows, soup, vsgi, fcgi, fcgi_vapi],
dependencies: [glib, gobject, gio, gio_platform, soup, vsgi, fcgi, fcgi_vapi],
install: true,
install_dir: '@0@/vsgi-@1@/servers'.format(get_option('libdir'), api_version))
endif
Expand Down
8 changes: 4 additions & 4 deletions tests/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,16 @@ test('response', executable('response-test', 'response-test.vala',
test('server', executable('server-test', 'server-test.vala',
dependencies: [glib, gobject, gio, soup, vsgi]))
test('http server', executable('http-server-test', 'http-server-test.vala',
dependencies: [glib, gobject, gio, gio_unix, soup, vsgi]),
dependencies: [glib, gobject, gio, gio_platform, soup, vsgi]),
env: ['G_TEST_SRCDIR=' + meson.current_source_dir()])
test('socket server', executable('socket-server-test', 'socket-server-test.vala',
dependencies: [glib, gobject, gio, gio_unix, soup, vsgi]))
dependencies: [glib, gobject, gio, gio_platform, soup, vsgi]))
if fcgi.found()
test('fastcgi server', executable('fastcgi-server-test', 'fastcgi-server-test.vala',
dependencies: [glib, gobject, gio, gio_unix, soup, vsgi]))
dependencies: [glib, gobject, gio, gio_platform, soup, vsgi]))
endif
loader_test_lib = shared_library('loader-test', 'loader-test.vala',
dependencies: [glib, gobject, gio, gio_unix, soup, vsgi])
dependencies: [glib, gobject, gio, gio_platform, soup, vsgi])
test('loader', vsgi_loader,
args: ['--directory', meson.current_build_dir(), '--server=cgi', 'loader-test'],
env: ['VSGI_SERVER_PATH=src/vsgi/servers'])
Expand Down

0 comments on commit 936a0fd

Please sign in to comment.