-
Notifications
You must be signed in to change notification settings - Fork 0
/
meson.build
55 lines (42 loc) · 1.47 KB
/
meson.build
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
project('tpak', 'c',
version : '0.1',
default_options : ['warning_level=3', 'c_std=gnu11'],
license: 'UNLICENSE')
conf = configuration_data()
cc = meson.get_compiler('c')
if cc.has_argument('-Wmultichar')
add_project_arguments('-Wno-multichar', language : 'c')
endif
if cc.has_argument('-Wfour-char-constants')
add_project_arguments('-Wno-four-char-constants', language : 'c')
endif
zlib_dep = dependency('zlib', fallback : ['zlib', 'zlib_dep'])
luajit_dep = dependency('luajit', version: '>=2.1.0', static: true, required: get_option('luajit'))
conf.set('HAVE_LUAJIT', luajit_dep.found())
editline_dep = dependency('libedit', required: false)
conf.set('HAVE_READLINE', editline_dep.found())
lib_sources = [ 'tpak.c' ]
exe_sources = [ 'main.c' ]
if luajit_dep.found()
luajit = find_program('luajit')
lua_gen = generator(luajit,
output : '@[email protected]',
arguments : ['-b', '@INPUT@', '@OUTPUT@'])
sc_h = lua_gen.process('sc.lua')
exe_sources += ['lua.c', sc_h]
endif
configure_file(output : 'config.h',
configuration : conf)
lib_tpak = library('tpak',
sources : lib_sources,
dependencies : [zlib_dep],
install : true,
soversion : '0')
install_headers('tpak.h')
tpak = executable('tpak',
sources : exe_sources,
dependencies : [zlib_dep, luajit_dep, editline_dep],
link_with : lib_tpak,
install : true)
libtpak_dep = declare_dependency(link_with: lib_tpak,
dependencies : [zlib_dep])