fixed windows build

This commit is contained in:
Sarah Faey 2025-05-07 17:59:50 +02:00
parent 794fa5bba0
commit 5aff6f6326
13 changed files with 33 additions and 27 deletions

View file

@ -6,9 +6,12 @@ cmake_minimum_required(VERSION 3.24)
# Set the project name
project(Witch-Game)
#find_package(SDL3 REQUIRED)
#find_package(SDL3_image REQUIRED)
#disable big libraries
#AVIF needs special compilers
set(SDLIMAGE_AVIF OFF)
set(SDLIMAGE_TIF OFF)
set(SDLIMAGE_WEBP OFF)
set(SDLIMAGE_JXL OFF)
#download SDL if not installed
#use git ls-remote --tags https://github.com/libsdl-org/SDL.git | tail -n 1
@ -42,11 +45,11 @@ set(DATA_STRUCTURES src/DataStructures/NormalizedDirection.cpp src/DataStructure
add_executable(Witch-Game main.cpp src/Game.cpp ${ACTORS} ${COMPONENTS} ${DATA_STRUCTURES})
target_compile_features(Witch-Game PRIVATE cxx_std_17)
target_link_libraries(Witch-Game SDL3 SDL3_image SDL3_ttf)
target_link_libraries(Witch-Game SDL3::SDL3 SDL3_image::SDL3_image SDL3_ttf::SDL3_ttf)
#set compiler flags for warnings
if(MSVC)
target_compile_options(Witch-Game PRIVATE /W4 /WX)
# target_compile_options(Witch-Game PRIVATE /W4 /WX)
else()
target_compile_options(Witch-Game PRIVATE -Wall -Wextra -Wpedantic)
endif()