-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmeson.build
More file actions
64 lines (56 loc) · 1.68 KB
/
meson.build
File metadata and controls
64 lines (56 loc) · 1.68 KB
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
63
64
project('ppm',
['c'],
license : 'PPM',
version : '1.2.0',
meson_version : '>= 0.56',
)
cc = meson.get_compiler('c')
zlib_dep = dependency('zlib')
lzma_dep = dependency('liblzma')
libgit2_dep = dependency('libgit2')
libzip_dep = dependency('libzip')
lua_dep = dependency('lua')
mbedtls_dep = [
dependency('mbedtls'),
dependency('mbedx509'),
dependency('mbedcrypto'),
]
microtar_lib = static_library('microtar', files('lib/microtar/src/microtar.c'))
microtar_dep = declare_dependency(
link_whole: [microtar_lib],
include_directories: ['lib/microtar/src']
)
ppm_source = files('src/ppm.c')
cflags = []
if get_option('static')
lua_exe = find_program('lua')
ppm_source += configure_file(
capture: false,
command: [lua_exe, '-e', 'f = string.dump(assert(load(io.lines("@INPUT0@", "L"), "=ppm.lua"))) io.open("@OUTPUT0@", "wb"):write("unsigned char ppm_luac[] = \"" .. f:gsub(".", function (c) return string.format("\\\x%02X",string.byte(c)) end) .. "\";unsigned int ppm_luac_len = " .. #f .. ";")'],
input: files('src/ppm.lua'),
output: 'ppm.lua.c'
)
cflags += '-DPPM_STATIC'
endif
ppm_exe = executable('ppm',
ppm_source,
dependencies: [
zlib_dep,
lzma_dep,
mbedtls_dep,
libgit2_dep,
libzip_dep,
lua_dep,
microtar_dep
],
c_args: cflags,
install: true,
)
if (get_option('install_plugin'))
pragtical_datadir = get_option('pragtical_datadir')
if pragtical_datadir == ''
# No path given, assume a default
pragtical_datadir = get_option('datadir') + '/pragtical'
endif
install_subdir('plugins', install_dir : pragtical_datadir)
endif