FIX: Exclude GLFW from test builds
All checks were successful
Tests / test (push) Successful in 2m37s
All checks were successful
Tests / test (push) Successful in 2m37s
This commit is contained in:
parent
ed86dd78dd
commit
00d10e4f0e
@ -32,7 +32,7 @@ jobs:
|
|||||||
run: git submodule update --init --recursive
|
run: git submodule update --init --recursive
|
||||||
|
|
||||||
- name: Konfigurieren
|
- name: Konfigurieren
|
||||||
run: cmake -B build
|
run: cmake -B build -DBUILD_GAME=OFF
|
||||||
|
|
||||||
- name: Nur Test-Target bauen
|
- name: Nur Test-Target bauen
|
||||||
run: cmake --build build --target LayoutEngineTests
|
run: cmake --build build --target LayoutEngineTests
|
||||||
|
|||||||
@ -1,23 +1,28 @@
|
|||||||
cmake_minimum_required(VERSION 3.31)
|
cmake_minimum_required(VERSION 3.20)
|
||||||
project(Dicewars_Siedler)
|
project(Dicewars_Siedler)
|
||||||
|
|
||||||
set(CMAKE_CXX_STANDARD 20)
|
set(CMAKE_CXX_STANDARD 20)
|
||||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||||
|
|
||||||
find_package(OpenGL REQUIRED)
|
option(BUILD_GAME "Build the game executable" ON)
|
||||||
|
|
||||||
add_subdirectory(lib/glfw)
|
# GLFW/OpenGL/Freetype nur laden wenn das Spiel gebaut wird
|
||||||
|
if(BUILD_GAME)
|
||||||
|
find_package(OpenGL REQUIRED)
|
||||||
|
add_subdirectory(lib/glfw)
|
||||||
|
|
||||||
add_library(glad STATIC
|
add_library(glad STATIC
|
||||||
lib/glad/src/glad.c
|
lib/glad/src/glad.c
|
||||||
)
|
)
|
||||||
target_include_directories(glad PUBLIC
|
target_include_directories(glad PUBLIC
|
||||||
lib/glad/include
|
lib/glad/include
|
||||||
)
|
)
|
||||||
|
|
||||||
find_package(Freetype REQUIRED)
|
find_package(Freetype REQUIRED)
|
||||||
include_directories(${FREETYPE_INCLUDE_DIRS})
|
include_directories(${FREETYPE_INCLUDE_DIRS})
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# Catch2 und Tests immer verfügbar
|
||||||
include(FetchContent)
|
include(FetchContent)
|
||||||
FetchContent_Declare(
|
FetchContent_Declare(
|
||||||
Catch2
|
Catch2
|
||||||
@ -29,19 +34,18 @@ FetchContent_MakeAvailable(Catch2)
|
|||||||
add_executable(LayoutEngineTests
|
add_executable(LayoutEngineTests
|
||||||
tests/layout/LayoutEngineTest.cpp
|
tests/layout/LayoutEngineTest.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
target_include_directories(LayoutEngineTests PRIVATE
|
target_include_directories(LayoutEngineTests PRIVATE
|
||||||
src
|
src
|
||||||
lib/glm
|
lib/glm
|
||||||
)
|
)
|
||||||
|
|
||||||
target_link_libraries(LayoutEngineTests PRIVATE Catch2::Catch2WithMain)
|
target_link_libraries(LayoutEngineTests PRIVATE Catch2::Catch2WithMain)
|
||||||
|
|
||||||
include(CTest)
|
include(CTest)
|
||||||
include(Catch)
|
include(Catch)
|
||||||
catch_discover_tests(LayoutEngineTests)
|
catch_discover_tests(LayoutEngineTests)
|
||||||
|
|
||||||
add_executable(Dicewars_Siedler src/main.cpp
|
if(BUILD_GAME)
|
||||||
|
add_executable(Dicewars_Siedler src/main.cpp
|
||||||
src/engine/core/Window.cpp
|
src/engine/core/Window.cpp
|
||||||
src/engine/core/Window.h
|
src/engine/core/Window.h
|
||||||
src/engine/platform/glfw/GLFWWindow.cpp
|
src/engine/platform/glfw/GLFWWindow.cpp
|
||||||
@ -285,28 +289,29 @@ add_executable(Dicewars_Siedler src/main.cpp
|
|||||||
src/game/GameWorldSystems.cpp
|
src/game/GameWorldSystems.cpp
|
||||||
src/game/GameWorldSystems.h
|
src/game/GameWorldSystems.h
|
||||||
src/engine/core/gui/uiComponent/layout/LayoutEngine.h
|
src/engine/core/gui/uiComponent/layout/LayoutEngine.h
|
||||||
)
|
)
|
||||||
|
target_compile_options(Dicewars_Siedler PRIVATE
|
||||||
target_compile_options(Dicewars_Siedler PRIVATE
|
|
||||||
-Wall
|
-Wall
|
||||||
-Wextra
|
-Wextra
|
||||||
-Wpedantic
|
-Wpedantic
|
||||||
-Werror=return-type
|
-Werror=return-type
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
target_include_directories(Dicewars_Siedler PRIVATE
|
target_include_directories(Dicewars_Siedler PRIVATE
|
||||||
lib/glfw/include
|
lib/glfw/include
|
||||||
lib/glm
|
lib/glm
|
||||||
lib/stb_image
|
lib/stb_image
|
||||||
lib/tinyobjloader
|
lib/tinyobjloader
|
||||||
lib/nlohmann
|
lib/nlohmann
|
||||||
)
|
)
|
||||||
|
|
||||||
target_link_libraries(Dicewars_Siedler
|
target_link_libraries(Dicewars_Siedler
|
||||||
PRIVATE
|
PRIVATE
|
||||||
glfw
|
glfw
|
||||||
glad
|
glad
|
||||||
OpenGL::GL
|
OpenGL::GL
|
||||||
${FREETYPE_LIBRARIES}
|
${FREETYPE_LIBRARIES}
|
||||||
)
|
)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user