Use more standard luac file extension when building Skeletool lua files

This commit is contained in:
Matt Penny 2024-11-12 02:25:40 -05:00
parent 1c6efda386
commit efb83d1923
2 changed files with 7 additions and 7 deletions

View File

@ -19,20 +19,20 @@ function(_add_embed_lua_command INPUT_FILE OUTPUT_LIST)
)
set(INPUT_FILE "${CMAKE_CURRENT_SOURCE_DIR}/${INPUT_FILE}")
set(OUTPUT_FILE_OBJ "${PROJECT_BINARY_DIR}/${RELATIVE_CURRENT_DIR}/${INPUT_NAME}.out")
set(OUTPUT_FILE_C "${OUTPUT_FILE_OBJ}.c")
set(OUTPUT_FILE_LUAC "${PROJECT_BINARY_DIR}/${RELATIVE_CURRENT_DIR}/${INPUT_NAME}.luac")
set(OUTPUT_FILE_C "${OUTPUT_FILE_LUAC}.c")
add_custom_command(
DEPENDS
${EMBED_RESOURCE} ${INPUT_FILE}
OUTPUT
${OUTPUT_FILE_OBJ} ${OUTPUT_FILE_C}
${OUTPUT_FILE_LUAC} ${OUTPUT_FILE_C}
COMMAND
${Luac_EXECUTABLE} -o ${OUTPUT_FILE_OBJ} ${INPUT_FILE}
${Luac_EXECUTABLE} -o ${OUTPUT_FILE_LUAC} ${INPUT_FILE}
COMMAND
# Use relative path for nice symbol name
${CMAKE_COMMAND}
-D INPUT_FILE=$<PATH:RELATIVE_PATH,${OUTPUT_FILE_OBJ},${PROJECT_BINARY_DIR}>
-D INPUT_FILE=$<PATH:RELATIVE_PATH,${OUTPUT_FILE_LUAC},${PROJECT_BINARY_DIR}>
-D OUTPUT_FILE=${OUTPUT_FILE_C}
-P ${EMBED_RESOURCE}
WORKING_DIRECTORY

View File

@ -13,7 +13,7 @@
#include <lua.hpp>
#include <iostream>
#define EMIT(name) extern const char _binary_lua_##name##_out[]; extern const size_t _binary_lua_##name##_out_size[];
#define EMIT(name) extern const char _binary_lua_##name##_luac[]; extern const size_t _binary_lua_##name##_luac_size[];
#include "LuaFiles.h"
#undef EMIT
@ -25,7 +25,7 @@ struct LuaFile {
};
struct LuaFile luaFiles[] = {
#define EMIT(name) {_binary_lua_##name##_out, *_binary_lua_##name##_out_size, "lua/" #name ".lua", #name},
#define EMIT(name) {_binary_lua_##name##_luac, *_binary_lua_##name##_luac_size, "lua/" #name ".lua", #name},
#include "LuaFiles.h"
#undef EMIT
};