-
-
Notifications
You must be signed in to change notification settings - Fork 7
/
meson.build
76 lines (65 loc) · 1.94 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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
# SPDX-FileCopyrightText: 2023 Giovanni Dante Grazioli <[email protected]>
# SPDX-License-Identifier: BSD-3-Clause
project('jsdec', 'c', meson_version: '>=0.55.0')
cc = meson.get_compiler('c')
libquickjs_proj = subproject('libquickjs', default_options: ['default_library=static'])
libquickjs_dep = libquickjs_proj.get_variable('quickjs_dep')
qjsc = libquickjs_proj.get_variable('qjsc')
jsdec_incs = ['.', 'c']
jsdec_c_args = []
jsdec_src = [
'c' / 'jsdec.c',
'c' / 'base64.c',
]
jsdec_deps = [
libquickjs_dep,
]
modjs_gen = executable('modjs_gen', 'tools' / 'modjs_gen.c',
dependencies: [],
include_directories: [],
implicit_include_directories: false,
install: false,
)
subdir('js')
if get_option('standalone')
jsdec_src += [
bytecode_h,
bytecode_mod_h,
'c' / 'jsdec-standalone.c',
]
jsdec_standalone = executable('jsdec-standalone', jsdec_src,
c_args : jsdec_c_args,
dependencies: jsdec_deps,
include_directories: include_directories(jsdec_incs),
implicit_include_directories: false,
install: false,
)
else
# build plugin for Rizin
rz_core_dep = dependency('rz_core')
jsdec_deps += rz_core_dep
jsdec_deps += dependency('rz_util')
jsdec_deps += dependency('rz_cons')
jsdec_deps += dependency('rz_config')
jsdec_deps += dependency('rz_io')
rizin_plugdir = get_option('rizin_plugdir')
if rizin_plugdir == ''
rizin_plugdir = rz_core_dep.get_variable(pkgconfig: 'plugindir', cmake: 'rz_core_PLUGINDIR')
plugin_jsdec_dir = join_paths(get_option('prefix'), rizin_plugdir, 'jsdec')
else
plugin_jsdec_dir = join_paths(rizin_plugdir, 'jsdec')
endif
jsdec_src += [
bytecode_h,
bytecode_mod_h,
'c' / 'jsdec-plugin.c'
]
shared_library('core_pdd', jsdec_src,
c_args : jsdec_c_args,
dependencies: jsdec_deps,
include_directories: include_directories(jsdec_incs),
implicit_include_directories: false,
install: true,
install_dir: rizin_plugdir
)
endif