Fixed some issues with Windows.

This commit is contained in:
Yohan Boujon 2025-03-10 00:03:48 +01:00
parent 049470b508
commit 65552b7301
3 changed files with 15 additions and 3 deletions

View file

@ -1,5 +1,7 @@
cmake_minimum_required(VERSION 3.21) cmake_minimum_required(VERSION 3.21)
project(yoyo_card)
# C/C++ Standard # C/C++ Standard
set(CMAKE_CXX_STANDARD 20) set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON) set(CMAKE_CXX_STANDARD_REQUIRED ON)

View file

@ -1,6 +1,6 @@
# Project # Project
project( project(
yoyo_card game
VERSION 1.0.0 VERSION 1.0.0
DESCRIPTION "Gabo card game recreation." DESCRIPTION "Gabo card game recreation."
HOMEPAGE_URL "https://www.etheryo.fr" HOMEPAGE_URL "https://www.etheryo.fr"
@ -23,9 +23,15 @@ target_link_libraries(${TARGET} raylib)
# Compilation depending on the platform # Compilation depending on the platform
if(MSVC) if(MSVC)
target_compile_options(${TARGET} PUBLIC /W3 /WX /DEBUG ) # Build the program as a window-only (no cmd)
if(CMAKE_BUILD_TYPE STREQUAL "Release")
target_link_options(${TARGET} PRIVATE "/SUBSYSTEM:WINDOWS")
target_compile_options(${TARGET} PRIVATE /W3 /WX )
else()
target_compile_options(${TARGET} PRIVATE /W3 /WX /DEBUG )
endif()
else() else()
target_compile_options(${TARGET} PUBLIC -Wall -Wextra -Wpedantic -Werror) target_compile_options(${TARGET} PRIVATE -Wall -Wextra -Wpedantic -Werror)
endif() endif()
# Output folder # Output folder

View file

@ -1,5 +1,9 @@
#include <raylib.h> #include <raylib.h>
#if defined(_MSC_VER) && !defined(_DEBUG)
#define main WinMain
#endif
int main(void) int main(void)
{ {
const int screenWidth = 800; const int screenWidth = 800;