Merge branch 'lua' of github.com:AnonymusRaccoon/Bomberman into ai_script

This commit is contained in:
Zoe Roux
2021-06-16 17:35:51 +02:00
9 changed files with 41 additions and 53 deletions
@@ -1,4 +1,4 @@
name: Windows Build
name: Build
on: [push, pull_request]
jobs:
@@ -7,10 +7,11 @@ jobs:
runs-on: ${{ matrix.os }}
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository
strategy:
fail-fast: false
matrix:
include:
# - os: ubuntu-latest
# name: Linux
- os: ubuntu-latest
name: Linux
# - os: macOS-latest
# name: MacOS
- os: windows-latest
@@ -22,10 +23,16 @@ jobs:
- name: Install Xorg lib
if: matrix.name == 'Linux'
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++
if: matrix.name == 'Linux'
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
run: |
mkdir build && cd build
-21
View File
@@ -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
+2
View File
@@ -9,6 +9,8 @@ jobs:
- uses: actions/checkout@v1
with:
submodules: true
- name: Install lua
run: sudo apt install -y liblua5.3-dev
- name: Exec
shell: bash
run: ./build_web.sh
+1 -1
View File
@@ -12,7 +12,7 @@ jobs:
submodules: true
- name: Install Xorg lib
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++
run: sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-10 100
- name: Build
+10 -15
View File
@@ -3,22 +3,20 @@ project(bomberman)
set(CMAKE_CXX_STANDARD 20)
cmake_minimum_required(VERSION 3.10)
include_directories(bomberman lib/Ray/sources)
include_directories(bomberman lib/wal/sources)
include_directories(bomberman lib/LuaGate/sources)
include_directories(bomberman sources)
include_directories(lib/Ray/sources)
include_directories(lib/wal/sources)
include_directories(lib/LuaGate/sources)
include_directories(sources)
add_subdirectory(${PROJECT_SOURCE_DIR}/lib/wal)
add_subdirectory(${PROJECT_SOURCE_DIR}/lib/Ray)
add_subdirectory(${PROJECT_SOURCE_DIR}/lib/LuaGate)
if (EMSCRIPTEN)
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_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 NO_DISABLE_EXCEPTION_CATCHING --shell-file ../sources/wasm/frontend.html --preload-file ../assets")
set(CMAKE_EXECUTABLE_SUFFIX ".html")
set(CMAKE_EXECUTABLE_SUFFIX ".html")
endif()
set(SOURCES
@@ -151,13 +149,11 @@ add_executable(bomberman
sources/main.cpp
${SOURCES}
)
target_include_directories(bomberman PUBLIC sources ${LUA_INCLUDE_DIR})
target_link_libraries(bomberman PUBLIC wal ray ${LUA_LIBRARIES} LuaGate)
target_link_libraries(bomberman PUBLIC wal ray LuaGate)
add_executable(unit_tests EXCLUDE_FROM_ALL
${SOURCES}
tests/CacheTest.cpp
tests/CacheTest.cpp
tests/EntityTests.cpp
tests/MainTest.cpp
tests/EngineTests.cpp
@@ -166,8 +162,7 @@ add_executable(unit_tests EXCLUDE_FROM_ALL
tests/ViewTest.cpp
tests/CollisionTest.cpp
)
target_include_directories(unit_tests PUBLIC sources)
target_link_libraries(unit_tests PUBLIC wal ray ${LUA_LIBRARIES})
target_link_libraries(unit_tests PUBLIC wal ray LuaGate)
find_package(Catch2 QUIET)
if (NOT Catch2_FOUND)
+16 -9
View File
@@ -1,9 +1,8 @@
CMAKE_MINIMUM_REQUIRED(VERSION 3.11)
cmake_minimum_required(VERSION 3.11)
set(CMAKE_CXX_STANDARD 20)
set(LIB_NAME "LuaGate")
project(LuaGate)
project("${LIB_NAME}")
include_directories(${LIB_NAME} ./sources)
include_directories(sources)
if (CMAKE_COMPILER_IS_GNUCXX)
set(GCC_COVERAGE_COMPILE_FLAGS "-Wall -Wextra -Werror -Wshadow")
@@ -18,9 +17,17 @@ set(SRC
sources/LuaGate.cpp
)
add_library(${LIB_NAME} STATIC ${SRC} ${HEADERS})
include(FindLua)
include_directories(${LIB_NAME} ${LUA_INCLUDE_DIR})
target_link_libraries(${LIB_NAME} ${LUA_LIBRARIES})
if (NOT LUA_FOUND)
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})
+1 -1
View File
@@ -3,7 +3,7 @@
//
#include <string>
#include "lua.hpp"
#include <lua.hpp>
namespace LuaG
{
@@ -7,7 +7,6 @@
#include "Map/MapInfo.hpp"
#include "Component/IAControllable/IAControllableComponent.hpp"
//#include "System/IAControllable/IAControllableSystem.hpp"
namespace BBM
{
@@ -11,7 +11,6 @@
#include "Component/Component.hpp"
#include "Entity/Entity.hpp"
#include "Models/Vector3.hpp"
#include "lua.hpp"
#include "LuaGate.hpp"
namespace BBM