mirror of
https://github.com/azerothcore/mod-ale
synced 2025-11-29 15:38:17 +08:00
feat(Github Action): Add all version in test action (#292)
This commit is contained in:
14
.github/workflows/build-lua51.yml
vendored
Normal file
14
.github/workflows/build-lua51.yml
vendored
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
name: Build mod-eluna with Lua51 🌙
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- 'master'
|
||||||
|
- 'main'
|
||||||
|
pull_request:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build_lua51:
|
||||||
|
uses: ./.github/workflows/core-build-base.yml
|
||||||
|
with:
|
||||||
|
lua_version: 'lua51'
|
||||||
14
.github/workflows/build-lua53.yml
vendored
Normal file
14
.github/workflows/build-lua53.yml
vendored
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
name: Build mod-eluna with Lua53 🌙
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- 'master'
|
||||||
|
- 'main'
|
||||||
|
pull_request:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build_lua53:
|
||||||
|
uses: ./.github/workflows/core-build-base.yml
|
||||||
|
with:
|
||||||
|
lua_version: 'lua53'
|
||||||
14
.github/workflows/build-lua54.yml
vendored
Normal file
14
.github/workflows/build-lua54.yml
vendored
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
name: Build mod-eluna with Lua54 🌙
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- 'master'
|
||||||
|
- 'main'
|
||||||
|
pull_request:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build_lua54:
|
||||||
|
uses: ./.github/workflows/core-build-base.yml
|
||||||
|
with:
|
||||||
|
lua_version: 'lua54'
|
||||||
@@ -54,9 +54,15 @@ FetchContent_Declare(
|
|||||||
)
|
)
|
||||||
FetchContent_MakeAvailable(${LUA_VERSION})
|
FetchContent_MakeAvailable(${LUA_VERSION})
|
||||||
|
|
||||||
# Easen warnings
|
# Easen warnings - disable Werror for Lua sources
|
||||||
string(REGEX REPLACE "( |^)/W[0-9]( |$)" "\\1/W2\\2" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
|
string(REGEX REPLACE "( |^)/W[0-9]( |$)" "\\1/W2\\2" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
|
||||||
string(REGEX REPLACE "( |^)/W[0-9]( |$)" "\\1/W2\\2" CMAKE_C_FLAGS "${CMAKE_C_FLAGS}")
|
string(REGEX REPLACE "( |^)/W[0-9]( |$)" "\\1/W2\\2" CMAKE_C_FLAGS "${CMAKE_C_FLAGS}")
|
||||||
|
# Remove -Werror from flags for Lua compilation
|
||||||
|
string(REGEX REPLACE "-Werror" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
|
||||||
|
string(REGEX REPLACE "-Werror" "" CMAKE_C_FLAGS "${CMAKE_C_FLAGS}")
|
||||||
|
# Also remove any warning-as-error flags
|
||||||
|
string(REGEX REPLACE "-Wno-error=[^ ]*" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
|
||||||
|
string(REGEX REPLACE "-Wno-error=[^ ]*" "" CMAKE_C_FLAGS "${CMAKE_C_FLAGS}")
|
||||||
|
|
||||||
set(LUA_SOURCE_FOLDER "${${LUA_VERSION}_SOURCE_DIR}/src")
|
set(LUA_SOURCE_FOLDER "${${LUA_VERSION}_SOURCE_DIR}/src")
|
||||||
|
|
||||||
@@ -100,10 +106,11 @@ if (WIN32)
|
|||||||
endif()
|
endif()
|
||||||
elseif (APPLE)
|
elseif (APPLE)
|
||||||
target_compile_definitions(lualib PUBLIC LUA_USE_MACOSX)
|
target_compile_definitions(lualib PUBLIC LUA_USE_MACOSX)
|
||||||
target_compile_options(lualib PRIVATE -Wno-deprecated-declarations -Wno-empty-body)
|
target_compile_options(lualib PRIVATE -Wno-deprecated-declarations -Wno-empty-body -Wno-unused-parameter -Wno-unused-variable -Wno-unused-function -Wno-sign-compare -Wno-string-plus-int)
|
||||||
target_link_libraries(lualib readline)
|
target_link_libraries(lualib readline)
|
||||||
elseif (UNIX)
|
elseif (UNIX)
|
||||||
target_compile_definitions(lualib PUBLIC LUA_USE_LINUX)
|
target_compile_definitions(lualib PUBLIC LUA_USE_LINUX)
|
||||||
|
target_compile_options(lualib PRIVATE -Wno-empty-body -Wno-unused-parameter -Wno-unused-variable -Wno-unused-function -Wno-sign-compare -Wno-string-plus-int)
|
||||||
target_link_libraries(lualib ${CMAKE_DL_LIBS} m readline)
|
target_link_libraries(lualib ${CMAKE_DL_LIBS} m readline)
|
||||||
set_target_properties(lualib PROPERTIES OUTPUT_NAME ${LUA_VERSION})
|
set_target_properties(lualib PROPERTIES OUTPUT_NAME ${LUA_VERSION})
|
||||||
endif()
|
endif()
|
||||||
@@ -111,6 +118,9 @@ endif()
|
|||||||
add_executable(lua_interpreter ${LUA_SOURCE_FOLDER}/lua.c)
|
add_executable(lua_interpreter ${LUA_SOURCE_FOLDER}/lua.c)
|
||||||
target_link_libraries(lua_interpreter lualib)
|
target_link_libraries(lua_interpreter lualib)
|
||||||
target_compile_definitions(lua_interpreter PRIVATE _CRT_SECURE_NO_WARNINGS)
|
target_compile_definitions(lua_interpreter PRIVATE _CRT_SECURE_NO_WARNINGS)
|
||||||
|
if (NOT WIN32)
|
||||||
|
target_compile_options(lua_interpreter PRIVATE -Wno-empty-body -Wno-unused-parameter -Wno-unused-variable -Wno-unused-function -Wno-sign-compare -Wno-string-plus-int)
|
||||||
|
endif()
|
||||||
set_target_properties(lua_interpreter PROPERTIES OUTPUT_NAME ${LUA_VERSION}_interpreter)
|
set_target_properties(lua_interpreter PROPERTIES OUTPUT_NAME ${LUA_VERSION}_interpreter)
|
||||||
if (WIN32)
|
if (WIN32)
|
||||||
install(TARGETS lua_interpreter DESTINATION "${CMAKE_INSTALL_PREFIX}")
|
install(TARGETS lua_interpreter DESTINATION "${CMAKE_INSTALL_PREFIX}")
|
||||||
@@ -122,10 +132,13 @@ endif()
|
|||||||
add_executable(lua_compiler ${LUA_SOURCE_FOLDER}/luac.c)
|
add_executable(lua_compiler ${LUA_SOURCE_FOLDER}/luac.c)
|
||||||
target_link_libraries(lua_compiler lualib)
|
target_link_libraries(lua_compiler lualib)
|
||||||
target_compile_definitions(lua_compiler PRIVATE _CRT_SECURE_NO_WARNINGS)
|
target_compile_definitions(lua_compiler PRIVATE _CRT_SECURE_NO_WARNINGS)
|
||||||
|
if (NOT WIN32)
|
||||||
|
target_compile_options(lua_compiler PRIVATE -Wno-empty-body -Wno-unused-parameter -Wno-unused-variable -Wno-unused-function -Wno-sign-compare -Wno-string-plus-int)
|
||||||
|
endif()
|
||||||
set_target_properties(lua_compiler PROPERTIES OUTPUT_NAME ${LUA_VERSION}_compiler)
|
set_target_properties(lua_compiler PROPERTIES OUTPUT_NAME ${LUA_VERSION}_compiler)
|
||||||
if (WIN32)
|
if (WIN32)
|
||||||
install(TARGETS lua_compiler DESTINATION "${CMAKE_INSTALL_PREFIX}")
|
install(TARGETS lua_compiler DESTINATION "${CMAKE_INSTALL_PREFIX}")
|
||||||
install(FILES $<TARGET_PDB_FILE:lua_compiler> DESTINATION "${CMAKE_INSTALL_PREFIX}" OPTIONAL)
|
install(FILES $<TARGET_PDB_FILE:lua_compiler> DESTINATION "${CMAKE_INSTALL_PREFIX}" OPTIONAL)
|
||||||
else()
|
else()
|
||||||
install(TARGETS lua_compiler DESTINATION "${CMAKE_INSTALL_PREFIX}/bin")
|
install(TARGETS lua_compiler DESTINATION "${CMAKE_INSTALL_PREFIX}/bin")
|
||||||
endif()
|
endif()
|
||||||
|
|||||||
@@ -29,6 +29,13 @@
|
|||||||
|
|
||||||
project ( lua C )
|
project ( lua C )
|
||||||
|
|
||||||
|
# Remove -Werror from flags for LuaJIT compilation
|
||||||
|
string(REGEX REPLACE "-Werror" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
|
||||||
|
string(REGEX REPLACE "-Werror" "" CMAKE_C_FLAGS "${CMAKE_C_FLAGS}")
|
||||||
|
# Also remove any warning-as-error flags
|
||||||
|
string(REGEX REPLACE "-Wno-error=[^ ]*" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
|
||||||
|
string(REGEX REPLACE "-Wno-error=[^ ]*" "" CMAKE_C_FLAGS "${CMAKE_C_FLAGS}")
|
||||||
|
|
||||||
# Download source
|
# Download source
|
||||||
include(FetchContent)
|
include(FetchContent)
|
||||||
FetchContent_Declare(
|
FetchContent_Declare(
|
||||||
@@ -131,7 +138,7 @@ if (UNIX OR APPLE)
|
|||||||
add_custom_command(
|
add_custom_command(
|
||||||
OUTPUT ${LUAJIT_LIB_PATH}
|
OUTPUT ${LUAJIT_LIB_PATH}
|
||||||
# COMMAND $(MAKE) -C ${LUA_BIN_FOLDER} PREFIX=${LUA_INSTALL_PATH}
|
# COMMAND $(MAKE) -C ${LUA_BIN_FOLDER} PREFIX=${LUA_INSTALL_PATH}
|
||||||
COMMAND $(MAKE) -C ${LUA_BIN_FOLDER} install PREFIX=${LUA_INSTALL_PATH}
|
COMMAND $(MAKE) -C ${LUA_BIN_FOLDER} install PREFIX=${LUA_INSTALL_PATH} "CFLAGS=-O2 -fomit-frame-pointer -Wno-empty-body -Wno-unused-parameter -Wno-unused-variable -Wno-unused-function -Wno-sign-compare -Wno-string-plus-int"
|
||||||
)
|
)
|
||||||
# endif()
|
# endif()
|
||||||
add_custom_target(luajit_target DEPENDS ${LUAJIT_LIB_PATH})
|
add_custom_target(luajit_target DEPENDS ${LUAJIT_LIB_PATH})
|
||||||
|
|||||||
Reference in New Issue
Block a user