Skip to content

Commit 725a986

Browse files
committed
continue using system lib on macos cross build
1 parent 6cae092 commit 725a986

File tree

3 files changed

+26
-3
lines changed

3 files changed

+26
-3
lines changed

external/sources/LuaJIT-2.1/meson.build

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,26 @@
11
# Meson files from github.com/franko/luajit
22
project('luajit', 'c', version : '2.0.5', default_options : ['c_winlibs='])
3+
34
pkg = import('pkgconfig')
45

56
cc = meson.get_compiler('c')
67
libm = cc.find_library('m', required : false)
78
libdl = cc.find_library('dl', required : false)
89
luajit_dependencies = [libm, libdl]
910

11+
1012
luajit_source_dir = include_directories('src')
1113
luajit_abiver = '51'
1214

15+
if not meson.can_run_host_binaries()
16+
warning('Can\'t properly build in cross environment, using system library instead!')
17+
else
18+
1319
dynasm = files('dynasm/dynasm.lua')
1420

1521
subdir('src')
1622

17-
if not get_option('use_prebuilt_libraries') or host_machine.system() in ['darwin', 'linux']
23+
if not get_option('use_prebuilt_libraries') or host_machine.system() in ['linux', 'darwin']
1824
libluajit = library(lj_libname, ljlib_sources + ljcore_sources + buildvm_headers,
1925
include_directories: luajit_source_dir,
2026
c_args: lj_defines,
@@ -40,3 +46,4 @@ luajit_dep = declare_dependency(
4046
)
4147

4248
meson.override_dependency('luajit', luajit_dep)
49+
endif

meson.build

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ elif host_machine.system() == 'windows'
218218
libpng_dep = dependency('libpng')
219219
# Windows Libraries
220220
opengl = compiler.find_library('opengl32')
221-
deps += [sdl2_dep, luajit_dep, zlib_dep, minizip_dep, libpng_dep, opengl]
221+
deps += [sdl2_dep, zlib_dep, minizip_dep, libpng_dep, opengl]
222222
endif
223223

224224

@@ -230,8 +230,9 @@ boost_dep = declare_dependency(include_directories: include_directories('externa
230230
meson.override_dependency('boost-175', boost_dep)
231231
install_rpath = prefix/get_option('fmod_dir')
232232
allegro_proj = subproject('allegro 4.4.3.1-custom')
233-
luajit = subproject('LuaJIT-2.1')
233+
luajit_proj = subproject('LuaJIT-2.1')
234234
luajit_dep = dependency('luajit')
235+
external_inc_dirs += luajit_proj.get_variable('luajit_source_dir')
235236
allegro_dep = dependency('allegro')
236237
loadpng_dep = dependency('loadpng')
237238
luabind_proj = subproject('luabind-0.7.1')

meson_osxcross.txt

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
[constants]
2+
arch = 'x86_64-apple-darwin20.2'
3+
[binaries]
4+
c = ['ccache', arch + '-gcc']
5+
cpp = ['ccache', arch + '-g++']
6+
strip = arch + '-strip'
7+
pkg-config = arch + '-pkg-config'
8+
ranlib = arch + '-gcc-ranlib'
9+
ar = arch + '-gcc-ar'
10+
11+
[host_machine]
12+
system = 'darwin'
13+
cpu_family = 'x86_64'
14+
cpu = 'x86_64'
15+
endian = 'little'

0 commit comments

Comments
 (0)