-
Notifications
You must be signed in to change notification settings - Fork 2
/
meson.build
72 lines (60 loc) · 1.32 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
project(
'flecs-luajit',
'c',
version: '0.1.0',
license: 'mit',
default_options: [
'c_std=c99',
'warning_level=3'
],
subproject_dir: 'external'
)
flecs_luajit_binding_srcs = subproject('flecs-luajit-binding').get_variable('srcs_flecs_lua')
# Generate resource headers for lua files
generate_file_header = find_program('scripts/generate_file_header.py')
gen_srcs = custom_target(
'resource-headers',
input: [
flecs_luajit_binding_srcs,
'src/cdef.lua',
'src/module_base.lua',
],
output: [
'flecs.lua.h',
'cdef.lua.h',
'module_base.lua.h',
],
command: [
generate_file_header,
'-i', '@INPUT@',
'-o', '@OUTPUT@',
'-d', '@SOURCE_ROOT@/src/res',
],
)
srcs = [
gen_srcs,
'src/flecs_ext.c',
'src/host.c',
'src/module_base.c',
]
deps = []
if build_machine.system() == 'linux'
deps += meson.get_compiler('c').find_library('m')
endif
deps += subproject('flecs').get_variable('flecs_dep')
deps += dependency('luajit', version: '>= 2.0')
args = []
if get_option('default_library') == 'shared'
args += '-DFLECS_LUAJIT_EXPORTS'
endif
flecs_luajit_lib = library(
'flecsluajit',
srcs,
c_args: args,
dependencies: deps,
)
flecs_luajit_dep = declare_dependency(
link_with: flecs_luajit_lib,
include_directories: include_directories('include'),
)
subdir('example')