2021-01-21 12:23:28 +01:00
|
|
|
project('luajit', 'c', version: '2.1.0', license: 'MIT')
|
2017-11-15 17:25:11 +01:00
|
|
|
|
|
|
|
cc = meson.get_compiler('c')
|
|
|
|
|
|
|
|
system_deps = [
|
2019-01-31 00:33:39 +01:00
|
|
|
cc.find_library('dl', required: false),
|
|
|
|
cc.find_library('m', required: false)
|
2017-11-15 17:25:11 +01:00
|
|
|
]
|
|
|
|
|
2020-10-27 18:06:35 +01:00
|
|
|
# compat flag is needed for both the buildvm code generator (compiled natively) and luajit itself
|
2021-03-27 15:58:42 +01:00
|
|
|
add_project_arguments('-DLUAJIT_ENABLE_LUA52COMPAT', '-DENDIAN_LE', language: 'c', native: true)
|
|
|
|
add_project_arguments('-DLUAJIT_ENABLE_LUA52COMPAT', '-DENDIAN_LE', language: 'c', native: false)
|
2017-11-15 17:25:11 +01:00
|
|
|
if host_machine.system() == 'linux'
|
2020-10-27 18:06:35 +01:00
|
|
|
add_project_arguments('-DLUAJIT_OS=LUAJIT_OS_LINUX', language: 'c', native: true)
|
2021-03-27 15:58:42 +01:00
|
|
|
add_project_arguments('-DLUAJIT_UNWIND_EXTERNAL', language: 'c', native: false)
|
2017-11-15 17:25:11 +01:00
|
|
|
readline_dep = cc.find_library('readline')
|
|
|
|
ljvm_mode = 'elfasm'
|
|
|
|
ljvm_bout = 'lj_vm.s'
|
|
|
|
elif host_machine.system() == 'darwin'
|
2020-10-27 18:06:35 +01:00
|
|
|
add_project_arguments('-DLUAJIT_OS=LUAJIT_OS_OSX', language: 'c', native: true)
|
2021-03-27 15:58:42 +01:00
|
|
|
add_project_arguments('-DLUAJIT_UNWIND_EXTERNAL', language: 'c', native: false)
|
2017-11-15 17:25:11 +01:00
|
|
|
readline_dep = cc.find_library('readline')
|
|
|
|
ljvm_mode = 'machasm'
|
|
|
|
ljvm_bout = 'lj_vm.s'
|
|
|
|
elif host_machine.system() == 'windows'
|
2020-10-27 18:06:35 +01:00
|
|
|
add_project_arguments('-DLUAJIT_OS=LUAJIT_OS_WINDOWS', language: 'c', native: true)
|
2019-02-17 18:22:30 +01:00
|
|
|
if cc.get_id() != 'msvc'
|
2020-10-27 18:06:35 +01:00
|
|
|
add_project_arguments('-malign-double', language: 'c', native: true)
|
2019-02-17 18:22:30 +01:00
|
|
|
endif
|
2017-11-15 17:25:11 +01:00
|
|
|
readline_dep = []
|
|
|
|
ljvm_mode = 'peobj'
|
|
|
|
ljvm_bout = 'lj_vm.o'
|
|
|
|
else
|
|
|
|
readline_dep = []
|
|
|
|
error('Unsupported platform')
|
|
|
|
endif
|
|
|
|
|
|
|
|
subdir('src')
|
|
|
|
|
2021-01-21 12:23:28 +01:00
|
|
|
luajit_dep = declare_dependency(link_with: luajit_lib, include_directories: src_inc)
|