mirror of
https://github.com/zoriya/Bomberman.git
synced 2026-06-09 20:25:31 +00:00
Merge branch 'lua' of github.com:AnonymusRaccoon/Bomberman into ai_script
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
name: Windows Build
|
name: Build
|
||||||
on: [push, pull_request]
|
on: [push, pull_request]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
@@ -7,10 +7,11 @@ jobs:
|
|||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository
|
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository
|
||||||
strategy:
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
include:
|
include:
|
||||||
# - os: ubuntu-latest
|
- os: ubuntu-latest
|
||||||
# name: Linux
|
name: Linux
|
||||||
# - os: macOS-latest
|
# - os: macOS-latest
|
||||||
# name: MacOS
|
# name: MacOS
|
||||||
- os: windows-latest
|
- os: windows-latest
|
||||||
@@ -22,10 +23,16 @@ jobs:
|
|||||||
- name: Install Xorg lib
|
- name: Install Xorg lib
|
||||||
if: matrix.name == 'Linux'
|
if: matrix.name == 'Linux'
|
||||||
run: |
|
run: |
|
||||||
sudo apt install -y libasound2-dev mesa-common-dev libx11-dev libxrandr-dev libxi-dev xorg-dev libgl1-mesa-dev libglu1-mesa-dev
|
sudo apt install -y libasound2-dev mesa-common-dev libx11-dev libxrandr-dev libxi-dev xorg-dev libgl1-mesa-dev libglu1-mesa-dev liblua5.3-dev
|
||||||
- name: Update G++
|
- name: Update G++
|
||||||
if: matrix.name == 'Linux'
|
if: matrix.name == 'Linux'
|
||||||
run: sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-10 100
|
run: sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-10 100
|
||||||
|
- name: Install Lua
|
||||||
|
if: matrix.name == 'Windows'
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
curl https://sourceforge.net/projects/luabinaries/files/5.4.2/Windows%20Libraries/Dynamic/lua-5.4.2_Win64_dll16_lib.zip/download -L > lua.zip
|
||||||
|
unzip lua
|
||||||
- name: Build
|
- name: Build
|
||||||
run: |
|
run: |
|
||||||
mkdir build && cd build
|
mkdir build && cd build
|
||||||
@@ -1,21 +0,0 @@
|
|||||||
name: Linux Build (Epitech Container)
|
|
||||||
on: [push, pull_request]
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
testbox:
|
|
||||||
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
container:
|
|
||||||
image: epitechcontent/epitest-docker:latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v2
|
|
||||||
with:
|
|
||||||
submodules: true
|
|
||||||
- name: Build
|
|
||||||
run: |
|
|
||||||
mkdir build && cd build
|
|
||||||
cmake ..
|
|
||||||
cmake --build .
|
|
||||||
- name: CheckBinaryName
|
|
||||||
shell: bash
|
|
||||||
run: test -f build/bomberman
|
|
||||||
@@ -9,6 +9,8 @@ jobs:
|
|||||||
- uses: actions/checkout@v1
|
- uses: actions/checkout@v1
|
||||||
with:
|
with:
|
||||||
submodules: true
|
submodules: true
|
||||||
|
- name: Install lua
|
||||||
|
run: sudo apt install -y liblua5.3-dev
|
||||||
- name: Exec
|
- name: Exec
|
||||||
shell: bash
|
shell: bash
|
||||||
run: ./build_web.sh
|
run: ./build_web.sh
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ jobs:
|
|||||||
submodules: true
|
submodules: true
|
||||||
- name: Install Xorg lib
|
- name: Install Xorg lib
|
||||||
run: |
|
run: |
|
||||||
sudo apt install -y libasound2-dev mesa-common-dev libx11-dev libxrandr-dev libxi-dev xorg-dev libgl1-mesa-dev libglu1-mesa-dev
|
sudo apt install -y libasound2-dev mesa-common-dev libx11-dev libxrandr-dev libxi-dev xorg-dev libgl1-mesa-dev libglu1-mesa-dev liblua5.3-dev
|
||||||
- name: Update G++
|
- name: Update G++
|
||||||
run: sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-10 100
|
run: sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-10 100
|
||||||
- name: Build
|
- name: Build
|
||||||
|
|||||||
+10
-15
@@ -3,22 +3,20 @@ project(bomberman)
|
|||||||
|
|
||||||
set(CMAKE_CXX_STANDARD 20)
|
set(CMAKE_CXX_STANDARD 20)
|
||||||
|
|
||||||
cmake_minimum_required(VERSION 3.10)
|
include_directories(lib/Ray/sources)
|
||||||
|
include_directories(lib/wal/sources)
|
||||||
include_directories(bomberman lib/Ray/sources)
|
include_directories(lib/LuaGate/sources)
|
||||||
include_directories(bomberman lib/wal/sources)
|
include_directories(sources)
|
||||||
include_directories(bomberman lib/LuaGate/sources)
|
|
||||||
include_directories(bomberman sources)
|
|
||||||
|
|
||||||
add_subdirectory(${PROJECT_SOURCE_DIR}/lib/wal)
|
add_subdirectory(${PROJECT_SOURCE_DIR}/lib/wal)
|
||||||
add_subdirectory(${PROJECT_SOURCE_DIR}/lib/Ray)
|
add_subdirectory(${PROJECT_SOURCE_DIR}/lib/Ray)
|
||||||
add_subdirectory(${PROJECT_SOURCE_DIR}/lib/LuaGate)
|
add_subdirectory(${PROJECT_SOURCE_DIR}/lib/LuaGate)
|
||||||
|
|
||||||
if (EMSCRIPTEN)
|
if (EMSCRIPTEN)
|
||||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -s USE_GLFW=3 -s ASSERTIONS=1 -s WASM=1 -s ASYNCIFY")
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -s USE_GLFW=3 -s ASSERTIONS=1 -s WASM=1 -s ASYNCIFY")
|
||||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -s USE_GLFW=3 -s ASSERTIONS=1 -s WASM=1 -s ASYNCIFY")
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -s USE_GLFW=3 -s ASSERTIONS=1 -s WASM=1 -s ASYNCIFY")
|
||||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -s NO_DISABLE_EXCEPTION_CATCHING --shell-file ../sources/wasm/frontend.html --preload-file ../assets")
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -s NO_DISABLE_EXCEPTION_CATCHING --shell-file ../sources/wasm/frontend.html --preload-file ../assets")
|
||||||
set(CMAKE_EXECUTABLE_SUFFIX ".html")
|
set(CMAKE_EXECUTABLE_SUFFIX ".html")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
set(SOURCES
|
set(SOURCES
|
||||||
@@ -151,13 +149,11 @@ add_executable(bomberman
|
|||||||
sources/main.cpp
|
sources/main.cpp
|
||||||
${SOURCES}
|
${SOURCES}
|
||||||
)
|
)
|
||||||
|
target_link_libraries(bomberman PUBLIC wal ray LuaGate)
|
||||||
target_include_directories(bomberman PUBLIC sources ${LUA_INCLUDE_DIR})
|
|
||||||
target_link_libraries(bomberman PUBLIC wal ray ${LUA_LIBRARIES} LuaGate)
|
|
||||||
|
|
||||||
add_executable(unit_tests EXCLUDE_FROM_ALL
|
add_executable(unit_tests EXCLUDE_FROM_ALL
|
||||||
${SOURCES}
|
${SOURCES}
|
||||||
tests/CacheTest.cpp
|
tests/CacheTest.cpp
|
||||||
tests/EntityTests.cpp
|
tests/EntityTests.cpp
|
||||||
tests/MainTest.cpp
|
tests/MainTest.cpp
|
||||||
tests/EngineTests.cpp
|
tests/EngineTests.cpp
|
||||||
@@ -166,8 +162,7 @@ add_executable(unit_tests EXCLUDE_FROM_ALL
|
|||||||
tests/ViewTest.cpp
|
tests/ViewTest.cpp
|
||||||
tests/CollisionTest.cpp
|
tests/CollisionTest.cpp
|
||||||
)
|
)
|
||||||
target_include_directories(unit_tests PUBLIC sources)
|
target_link_libraries(unit_tests PUBLIC wal ray LuaGate)
|
||||||
target_link_libraries(unit_tests PUBLIC wal ray ${LUA_LIBRARIES})
|
|
||||||
|
|
||||||
find_package(Catch2 QUIET)
|
find_package(Catch2 QUIET)
|
||||||
if (NOT Catch2_FOUND)
|
if (NOT Catch2_FOUND)
|
||||||
|
|||||||
@@ -1,9 +1,8 @@
|
|||||||
CMAKE_MINIMUM_REQUIRED(VERSION 3.11)
|
cmake_minimum_required(VERSION 3.11)
|
||||||
set(CMAKE_CXX_STANDARD 20)
|
set(CMAKE_CXX_STANDARD 20)
|
||||||
set(LIB_NAME "LuaGate")
|
project(LuaGate)
|
||||||
|
|
||||||
project("${LIB_NAME}")
|
include_directories(sources)
|
||||||
include_directories(${LIB_NAME} ./sources)
|
|
||||||
|
|
||||||
if (CMAKE_COMPILER_IS_GNUCXX)
|
if (CMAKE_COMPILER_IS_GNUCXX)
|
||||||
set(GCC_COVERAGE_COMPILE_FLAGS "-Wall -Wextra -Werror -Wshadow")
|
set(GCC_COVERAGE_COMPILE_FLAGS "-Wall -Wextra -Werror -Wshadow")
|
||||||
@@ -18,9 +17,17 @@ set(SRC
|
|||||||
sources/LuaGate.cpp
|
sources/LuaGate.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
add_library(${LIB_NAME} STATIC ${SRC} ${HEADERS})
|
|
||||||
|
|
||||||
|
|
||||||
include(FindLua)
|
include(FindLua)
|
||||||
include_directories(${LIB_NAME} ${LUA_INCLUDE_DIR})
|
if (NOT LUA_FOUND)
|
||||||
target_link_libraries(${LIB_NAME} ${LUA_LIBRARIES})
|
if (EXISTS ${CMAKE_SOURCE_DIR}/include/lua.hpp)
|
||||||
|
message("Using local lua")
|
||||||
|
set(LUA_INCLUDE_DIR ${CMAKE_SOURCE_DIR}/include/)
|
||||||
|
set(LUA_LIBRARIES ${CMAKE_SOURCE_DIR}/lua54.lib)
|
||||||
|
else()
|
||||||
|
message(FATAL_ERROR "Lua could not be found.")
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
add_library(LuaGate STATIC ${SRC} ${HEADERS})
|
||||||
|
target_include_directories(LuaGate PUBLIC ${LUA_INCLUDE_DIR})
|
||||||
|
target_link_libraries(LuaGate ${LUA_LIBRARIES})
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
//
|
//
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
#include "lua.hpp"
|
#include <lua.hpp>
|
||||||
|
|
||||||
namespace LuaG
|
namespace LuaG
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -7,7 +7,6 @@
|
|||||||
|
|
||||||
#include "Map/MapInfo.hpp"
|
#include "Map/MapInfo.hpp"
|
||||||
#include "Component/IAControllable/IAControllableComponent.hpp"
|
#include "Component/IAControllable/IAControllableComponent.hpp"
|
||||||
//#include "System/IAControllable/IAControllableSystem.hpp"
|
|
||||||
|
|
||||||
namespace BBM
|
namespace BBM
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -11,7 +11,6 @@
|
|||||||
#include "Component/Component.hpp"
|
#include "Component/Component.hpp"
|
||||||
#include "Entity/Entity.hpp"
|
#include "Entity/Entity.hpp"
|
||||||
#include "Models/Vector3.hpp"
|
#include "Models/Vector3.hpp"
|
||||||
#include "lua.hpp"
|
|
||||||
#include "LuaGate.hpp"
|
#include "LuaGate.hpp"
|
||||||
|
|
||||||
namespace BBM
|
namespace BBM
|
||||||
|
|||||||
Reference in New Issue
Block a user