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
|
||||
|
||||
- name: Konfigurieren
|
||||
run: cmake -B build
|
||||
run: cmake -B build -DBUILD_GAME=OFF
|
||||
|
||||
- name: Nur Test-Target bauen
|
||||
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)
|
||||
|
||||
set(CMAKE_CXX_STANDARD 20)
|
||||
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
|
||||
)
|
||||
target_include_directories(glad PUBLIC
|
||||
)
|
||||
target_include_directories(glad PUBLIC
|
||||
lib/glad/include
|
||||
)
|
||||
)
|
||||
|
||||
find_package(Freetype REQUIRED)
|
||||
include_directories(${FREETYPE_INCLUDE_DIRS})
|
||||
find_package(Freetype REQUIRED)
|
||||
include_directories(${FREETYPE_INCLUDE_DIRS})
|
||||
endif()
|
||||
|
||||
# Catch2 und Tests immer verfügbar
|
||||
include(FetchContent)
|
||||
FetchContent_Declare(
|
||||
Catch2
|
||||
@ -29,19 +34,18 @@ FetchContent_MakeAvailable(Catch2)
|
||||
add_executable(LayoutEngineTests
|
||||
tests/layout/LayoutEngineTest.cpp
|
||||
)
|
||||
|
||||
target_include_directories(LayoutEngineTests PRIVATE
|
||||
src
|
||||
lib/glm
|
||||
)
|
||||
|
||||
target_link_libraries(LayoutEngineTests PRIVATE Catch2::Catch2WithMain)
|
||||
|
||||
include(CTest)
|
||||
include(Catch)
|
||||
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.h
|
||||
src/engine/platform/glfw/GLFWWindow.cpp
|
||||
@ -285,28 +289,29 @@ add_executable(Dicewars_Siedler src/main.cpp
|
||||
src/game/GameWorldSystems.cpp
|
||||
src/game/GameWorldSystems.h
|
||||
src/engine/core/gui/uiComponent/layout/LayoutEngine.h
|
||||
)
|
||||
|
||||
target_compile_options(Dicewars_Siedler PRIVATE
|
||||
)
|
||||
target_compile_options(Dicewars_Siedler PRIVATE
|
||||
-Wall
|
||||
-Wextra
|
||||
-Wpedantic
|
||||
-Werror=return-type
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
target_include_directories(Dicewars_Siedler PRIVATE
|
||||
target_include_directories(Dicewars_Siedler PRIVATE
|
||||
lib/glfw/include
|
||||
lib/glm
|
||||
lib/stb_image
|
||||
lib/tinyobjloader
|
||||
lib/nlohmann
|
||||
)
|
||||
)
|
||||
|
||||
target_link_libraries(Dicewars_Siedler
|
||||
target_link_libraries(Dicewars_Siedler
|
||||
PRIVATE
|
||||
glfw
|
||||
glad
|
||||
OpenGL::GL
|
||||
${FREETYPE_LIBRARIES}
|
||||
)
|
||||
)
|
||||
endif()
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user