fix:修正导出脚本。

This commit is contained in:
taynpg 2025-02-13 13:29:41 +08:00
parent 2a81f98f16
commit e93466b22e
2 changed files with 26 additions and 9 deletions

View File

@ -3,24 +3,17 @@ setlocal
:: 定义路径 :: 定义路径
set EXPORT_DIR=export set EXPORT_DIR=export
set LUA_DIR=%EXPORT_DIR%\lua
set MLUA_EXE=%EXPORT_DIR%\mlua.exe set MLUA_EXE=%EXPORT_DIR%\mlua.exe
set LUA_LS=%EXPORT_DIR%\lua_ls.lua
set BUILD_BIN=build\bin set BUILD_BIN=build\bin
set GENDEF_EXE=%BUILD_BIN%\gendef.exe set GENDEF_EXE=%BUILD_BIN%\gendef.exe
set FS_LIB=fs\lib.cxx set FS_LIB=fs\lib.cxx
:: 创建 export 和 lua 文件夹
if not exist %EXPORT_DIR% ( if not exist %EXPORT_DIR% (
mkdir %EXPORT_DIR% mkdir %EXPORT_DIR%
) )
if not exist %LUA_DIR% (
mkdir %LUA_DIR%
)
copy /Y %BUILD_BIN%\mlua.exe %MLUA_EXE% copy /Y %BUILD_BIN%\mlua.exe %MLUA_EXE%
%GENDEF_EXE% %FS_LIB% lua_ls %LUA_DIR% %GENDEF_EXE% %FS_LIB% lua_ls %EXPORT_DIR%
copy /Y %BUILD_BIN%\lua_fs.dll %LUA_DIR% copy /Y %BUILD_BIN%\lua_fs.dll %EXPORT_DIR%
echo 操作完成。 echo 操作完成。
endlocal endlocal
pause pause

24
def_gen.sh Executable file
View File

@ -0,0 +1,24 @@
#!/bin/bash
set -e # 遇到错误时退出
# 定义路径
EXPORT_DIR="export"
MLUA_EXE="$EXPORT_DIR/mlua"
BUILD_BIN="build/bin"
LIB_DIR="build/lib"
GENDEF_EXE="$BUILD_BIN/gendef"
FS_LIB="fs/lib.cxx"
# 创建 export 和 lua 目录
mkdir -p "$EXPORT_DIR"
# 复制 mlua 可执行文件
cp -f "$BUILD_BIN/mlua" "$MLUA_EXE"
# 运行 gendef
"$GENDEF_EXE" "$FS_LIB" lua_ls "$EXPORT_DIR"
# 复制 lua_fs 动态库
cp -f "$LIB_DIR/liblua_fs.so" "$EXPORT_DIR/lua_fs.so"
echo "导出完成。"