~sircmpwn/koio

ref: fe222dd24a858f57ffa954a28f1608062e340716 koio/meson.build -rw-r--r-- 1.2 KiB
fe222dd2Drew DeVault Install koio.h 4 years ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
project(
	'koio',
	'c',
	version: '0.0.1',
	license: 'MIT',
	meson_version: '>=0.43.0',
	default_options: [
		'c_std=c11',
		'warning_level=2',
		'werror=true',
	],
)

# Format of so_version is CURRENT, REVISION, AGE.
# See: https://autotools.io/libtool/version.html
# for a reference about clean library versioning.
so_version = ['0', '0', '0']

add_project_arguments('-Wno-unused-parameter', language: 'c')

koio_inc = include_directories('include')

symbols_file = 'koio.syms'
symbols_flag = '-Wl,--version-script,@0@/@1@'.format(
	meson.current_source_dir(), symbols_file)
lib_koio = library(meson.project_name(),
	[
		'lib/ko_add_file.c',
		'lib/ko_del_file.c',
		'lib/ko_fopen.c',
		'lib/hashtable.c'
	],
	version: '.'.join(so_version),
	include_directories: koio_inc,
	install: true,
	link_args: symbols_flag,
)

install_headers('include/koio.h')

koio = declare_dependency(
	link_with: lib_koio,
	include_directories: koio_inc,
)

koio_tool = executable(meson.project_name(), [
	'tool/main.c'
], install: true)

cat_gen = custom_target('cat_gen.c',
	build_by_default: true,
	input: ['cat/main.c'],
	output: 'cat_gen.c',
	command: [koio_tool, '-o', '@OUTPUT@', '@INPUT@://main.c']
)

cat = executable('cat', [
		'cat/main.c',
		cat_gen
	],
	dependencies: [koio]
)