From 8128bf7325bb1814b011b9e75c8279fd3e0929cd Mon Sep 17 00:00:00 2001 From: fesily Date: Fri, 13 Dec 2024 16:38:19 +0800 Subject: [PATCH] fix build error --- compile/luajit/make.lua | 6 +++++- compile/luajit/make_windows.lua | 5 ++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/compile/luajit/make.lua b/compile/luajit/make.lua index 8f4f181d..87451fd5 100644 --- a/compile/luajit/make.lua +++ b/compile/luajit/make.lua @@ -10,6 +10,7 @@ local arch = defined.arch local LUAJIT_ENABLE_LUA52COMPAT = defined.LUAJIT_ENABLE_LUA52COMPAT local LUAJIT_NUMMODE = defined.LUAJIT_NUMMODE local luajitDir = defined.luajitDir +local is_old_version_luajit = defined.is_old_version_luajit local LJLIB_C = { luajitDir .. "/lib_base.c ", @@ -144,7 +145,10 @@ lm:executable("luajit/lua") { "lj_libdef.h", "lj_recdef.h", }, - deps = has_str_hash and "lj_str_hash.c", + deps = { + has_str_hash and "lj_str_hash.c", + not is_old_version_luajit and "luajit_h" + }, sources = { "luajit.c", "lj_*.c", diff --git a/compile/luajit/make_windows.lua b/compile/luajit/make_windows.lua index 54f3bb8a..302692da 100644 --- a/compile/luajit/make_windows.lua +++ b/compile/luajit/make_windows.lua @@ -1,11 +1,10 @@ local lm = require "luamake" -local fs = require 'bee.filesystem' local luaver = "luajit" local luajitDir = '3rd/lua/' .. luaver local luajitSrcDir = luajitDir .. '/src' local bindir = "publish/runtime/"..lm.runtime_platform -local is_old_version_luajit = fs.exists(fs.path(luajitSrcDir) / 'lj_init.c') +local is_old_version_luajit = require "compile.luajit.defined".is_old_version_luajit lm:exe "minilua" { rootdir= luajitDir, @@ -181,7 +180,7 @@ lm:shared_library "luajit/luajit" { "lj_recdef", --"lj_vmdef", "lj_folddef", - "luajit_h", + not is_old_version_luajit and "luajit_h", }, defines = { "_CRT_SECURE_NO_WARNINGS",