meson: luajit: Set correct LUAJIT_TARGET for buildvm

On native builds this is derived automatically, but on cross builds
it needs to be set explicitly.
This commit is contained in:
arch1t3cht 2023-11-06 22:44:18 +01:00
parent 1ba7979ff4
commit 24c8144e91
1 changed files with 4 additions and 0 deletions

View File

@ -7,6 +7,10 @@ system_deps = [
cc.find_library('m', required: false)
]
# get architecture id for the host machine so it can be set when compiling buildvm natively
lj_target_id = cc.get_define('LUAJIT_TARGET', prefix: '#include "@0@/src/lj_arch.h"'.format(meson.current_source_dir()))
add_project_arguments('-DLUAJIT_TARGET=@0@'.format(lj_target_id), language: 'c', native: true)
# compat flag is needed for both the buildvm code generator (compiled natively) and luajit itself
add_project_arguments('-DLUAJIT_ENABLE_LUA52COMPAT', '-DENDIAN_LE', language: 'c', native: true)
add_project_arguments('-DLUAJIT_ENABLE_LUA52COMPAT', '-DENDIAN_LE', language: 'c', native: false)