-
Notifications
You must be signed in to change notification settings - Fork 32
/
meson.build
71 lines (61 loc) · 1.87 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
project('frogfs', 'c')
frogfs_includes = include_directories('include')
frogfs_sources = files(
'src' / 'decomp_raw.c',
'src' / 'frogfs.c',
)
frogfs_defines = []
frogfs_deps = []
log_level = get_option('log-level')
if log_level == 'none'
frogfs_defines += '-DCONFIG_FROGFS_LOG_LEVEL_NONE=1'
elif log_level == 'error'
frogfs_defines += '-DCONFIG_FROGFS_LOG_LEVEL_ERROR=1'
elif log_level == 'warn'
frogfs_defines += '-DCONFIG_FROGFS_LOG_LEVEL_WARN=1'
elif log_level == 'info'
frogfs_defines += '-DCONFIG_FROGFS_LOG_LEVEL_INFO=1'
elif log_level == 'debug'
frogfs_defines += '-DCONFIG_FROGFS_LOG_LEVEL_DEBUG=1'
elif log_level == 'verbose'
frogfs_defines += '-DCONFIG_FROGFS_LOG_LEVEL_VERBOSE=1'
endif
if get_option('use-heatshrink')
heatshrink_dep = dependency('heatshrink')
frogfs_sources += files(
'src' / 'decomp_heatshrink.c',
)
frogfs_defines += '-DCONFIG_FROGFS_USE_HEATSHRINK=1'
frogfs_deps += heatshrink_dep
endif
if get_option('use-miniz')
miniz_dep = dependency('miniz')
frogfs_sources += files(
'src' / 'decomp_miniz.c',
)
frogfs_defines += '-DCONFIG_FROGFS_USE_MINIZ=1'
frogfs_deps += miniz_dep
endif
if get_option('use-zlib')
zlib_dep = dependency('libz', required: true)
frogfs_sources += files(
'src' / 'decomp_zlib.c',
)
frogfs_defines += '-DCONFIG_FROGFS_USE_ZLIB=1'
frogfs_deps += zlib_dep
endif
libfrogfs = static_library('frogfs',
frogfs_sources,
dependencies: frogfs_deps,
include_directories: frogfs_includes
)
frogfs_dep = declare_dependency(
link_with: libfrogfs,
include_directories: frogfs_includes
)
meson.override_dependency('frogfs', frogfs_dep)
bin2c_py = find_program('tools' / 'bin2c.py')
mkfrogfs_py = find_program('tools' / 'mkfrogfs.py')
# silence language server unused variable warnings
bin2c_py = bin2c_py
mkfrogfs_py = mkfrogfs_py