forked from TypesettingTools/ffi-experiments
-
Notifications
You must be signed in to change notification settings - Fork 0
/
meson.build
64 lines (53 loc) · 1.91 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
project('ffi-experiments', 'c', 'cpp',
license: 'ISC',
meson_version: '>=0.49.0',
default_options: ['c_std=c99', 'cpp_std=c++14', 'buildtype=release', 'b_ndebug=if-release']
)
deps = []
inc_dirs = []
static_deps = get_option('static_deps')
libcurl_path = get_option('libcurl_path')
cc = meson.get_compiler('c')
cxx = meson.get_compiler('cpp')
if host_machine.system() == 'windows' or static_deps == 'true'
add_project_arguments('-DCURL_STATICLIB', language: ['cpp'])
endif
if cc.get_argument_syntax() == 'gcc'
cflags = ['-Wunreachable-code', '-Wfloat-equal', '-Wredundant-decls', '-Winit-self', '-Wpedantic']
add_project_arguments(cc.get_supported_arguments(cflags), language: ['c', 'cpp'])
endif
if host_machine.system() == 'windows' and libcurl_path != ''
deps += cxx.find_library('libcurl', dirs: join_paths(libcurl_path, 'lib'))
inc_dirs += include_directories(join_paths(libcurl_path, 'include'))
deps += cxx.find_library('crypt32')
deps += cxx.find_library('normaliz')
deps += cxx.find_library('wininet')
deps += cxx.find_library('wldap32')
deps += cxx.find_library('ws2_32')
else
deps += dependency('libcurl', static: static_deps)
endif
if host_machine.system() == 'darwin'
deps += dependency('appleframeworks', modules: ['CoreFoundation', 'SystemConfiguration'])
endif
if host_machine.system() == 'linux'
deps += dependency('threads', static: static_deps)
endif
lua_builder = find_program('BuildLua.sh')
subdir('bad-mutex')
subdir('precise-timer')
subdir('download-manager')
subdir('requireffi')
if host_machine.system() != 'windows'
# meson is garbage and run_target appears to be the only way to
# actually add a new compilation target to ninja.
run_target('lua',
command: find_program('true'),
depends: [
bad_mutex_lua,
download_manager_lua,
precise_timer_lua,
requireffi_lua
]
)
endif