Skip to content

Commit

Permalink
meson: luajit: Set correct LUAJIT_TARGET for buildvm
Browse files Browse the repository at this point in the history
On native builds this is derived automatically, but on cross builds
it needs to be set explicitly.
  • Loading branch information
arch1t3cht authored and CoffeeFlux committed Dec 3, 2023
1 parent 3852dc0 commit 44b5fc3
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions subprojects/packagefiles/luajit/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 44b5fc3

Please sign in to comment.