2019-01-31 00:33:39 +01:00
|
|
|
project('luajit', 'c', version: '2.0.4', 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
|
|
|
]
|
|
|
|
|
|
|
|
system_deps_native = [
|
2019-01-31 00:33:39 +01:00
|
|
|
cc.find_library('dl', required: false, native: true),
|
|
|
|
cc.find_library('m', required: false, native: true)
|
2017-11-15 17:25:11 +01:00
|
|
|
]
|
|
|
|
|
2019-01-31 00:33:39 +01:00
|
|
|
add_project_arguments('-DLUAJIT_ENABLE_LUA52COMPAT', language: 'c')
|
2017-11-15 17:25:11 +01:00
|
|
|
if host_machine.system() == 'linux'
|
2019-01-31 00:33:39 +01:00
|
|
|
add_project_arguments('-DLUAJIT_USE_LINUX', language: 'c')
|
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'
|
2019-01-31 00:33:39 +01:00
|
|
|
add_project_arguments(['-DLUAJIT_USE_MACOSX'], language: 'c')
|
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'
|
|
|
|
add_project_arguments('-DLUAJIT_USE_WINDOWS', '-DWIN',
|
2019-01-31 00:33:39 +01:00
|
|
|
'-malign-double', language: 'c')
|
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
|
|
|
|
|
|
|
|
incdir = include_directories('include')
|
|
|
|
|
|
|
|
subdir('src')
|
|
|
|
|
2019-01-31 00:33:39 +01:00
|
|
|
luajit_dep = declare_dependency(link_with: luajit_lib,
|
|
|
|
include_directories: incdir)
|