Merge pull request #140 from Cogitri/meson

Add support for building with meson
This commit is contained in:
Sönke Ludwig 2020-05-11 17:06:42 +02:00 committed by GitHub
commit 8c2790c66e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 81 additions and 0 deletions

15
meson.build Normal file
View file

@ -0,0 +1,15 @@
project('eventcore', 'd',
meson_version: '>=0.50',
version: '0.8.50'
)
project_soversion = '0'
project_version_suffix = ''
project_version = meson.project_version()
project_version_full = project_version + project_version_suffix
taggedalgebraic_dep = dependency('taggedalgebraic', version: ['>=0.10.12', '<0.12'])
source_root = meson.source_root()
build_root = meson.build_root()
subdir('source/eventcore')

View file

@ -0,0 +1,66 @@
eventcore_src = [
'core.d',
'driver.d',
'drivers/libasync.d',
'drivers/posix/dns.d',
'drivers/posix/driver.d',
'drivers/posix/epoll.d',
'drivers/posix/events.d',
'drivers/posix/kqueue.d',
'drivers/posix/pipes.d',
'drivers/posix/processes.d',
'drivers/posix/select.d',
'drivers/posix/signals.d',
'drivers/posix/sockets.d',
'drivers/posix/watchers.d',
'drivers/threadedfile.d',
'drivers/timer.d',
'drivers/winapi/core.d',
'drivers/winapi/dns.d',
'drivers/winapi/driver.d',
'drivers/winapi/events.d',
'drivers/winapi/files.d',
'drivers/winapi/pipes.d',
'drivers/winapi/processes.d',
'drivers/winapi/signals.d',
'drivers/winapi/sockets.d',
'drivers/winapi/watchers.d',
'internal/consumablequeue.d',
'internal/dlist.d',
'internal/utils.d',
'internal/win32.d',
'socket.d',
]
eventcore_lib = library(
'eventcore',
eventcore_src,
version: project_version,
install: true,
include_directories: include_directories('../'),
dependencies: taggedalgebraic_dep,
)
pkgc = import('pkgconfig')
pkgc.generate(
eventcore_lib,
subdirs: 'd/eventcore',
)
install_headers(
eventcore_src,
subdir: 'd/eventcore/eventcore',
)
test_exe = executable(
'eventcore_test',
eventcore_src,
include_directories: include_directories('../'),
d_unittest: true,
d_args: '-main',
dependencies: taggedalgebraic_dep,
)
test('test_eventcore', test_exe)