Skip to content

Commit 44e94f7

Browse files
committed
First stab add adding a Meson build system
Add meson.build and try to convert this to use Meson rather than CMake as a build system. This is still experimental. Get a .pc file as part of the Meson build system.
1 parent 212c17b commit 44e94f7

File tree

1 file changed

+64
-0
lines changed

1 file changed

+64
-0
lines changed

meson.build

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
project('libepoll-shim', 'c',
2+
version : '0.0.1',
3+
license : 'MIT',
4+
default_options : [ 'c_std=c11' ],
5+
meson_version : '>=0.40.0' )
6+
7+
libepollshim_version = meson.project_version().split('.')
8+
9+
dir_data = join_paths(get_option('prefix'), get_option('datadir'))
10+
dir_sysconf = join_paths(get_option('prefix'), get_option('sysconfdir'))
11+
dir_libexec = join_paths(get_option('prefix'), get_option('libexecdir'))
12+
dir_lib = join_paths(get_option('prefix'), get_option('libdir'))
13+
dir_include = join_paths(get_option('prefix'), get_option('includedir'), 'libepoll-shim/sys')
14+
dir_src_test = join_paths(meson.source_root(), 'test')
15+
dir_src = join_paths(meson.source_root(), 'src')
16+
17+
# Compiler setup
18+
cc = meson.get_compiler('c')
19+
cflags = ['-Wall', '-Wextra', '-Werror', '-fvisibility=hidden']
20+
add_project_arguments(cflags, language: 'c')
21+
22+
#-Wno-missing-prototypes -Wno-padded -Wno-missing-variable-declarations -Wno-thread-safety-analysis
23+
24+
libepollshim_so_version = '0.0.0'
25+
26+
# Dependencies
27+
thread_dep = dependency('threads')
28+
pkgconfig = import('pkgconfig')
29+
30+
# Include directories
31+
includes_include = include_directories('include')
32+
33+
header_libepollshim = [ 'include/sys/epoll.h',
34+
'include/sys/timerfd.h',
35+
'include/sys/signalfd.h'
36+
]
37+
38+
install_headers(header_libepollshim, subdir : 'libepoll-shim/sys')
39+
40+
src_libepollshim = [ 'src/epoll.c',
41+
'src/timerfd.c',
42+
'src/signalfd.c',
43+
'src/common.c'
44+
]
45+
46+
src_libepollshim += header_libepollshim
47+
48+
deps_libepollshim = [ thread_dep ]
49+
50+
lib_libepollshim = shared_library('epoll-shim',
51+
src_libepollshim,
52+
include_directories : includes_include,
53+
dependencies : deps_libepollshim,
54+
version : libepollshim_so_version,
55+
install : true
56+
)
57+
58+
pkgconfig.generate(
59+
filebase : 'libepoll-shim',
60+
name : 'libepoll-shim',
61+
description : 'small epoll implementation using kqueue',
62+
version : meson.project_version(),
63+
libraries : lib_libepollshim
64+
)

0 commit comments

Comments
 (0)