diff --git a/CMakeLists.txt b/CMakeLists.txt index 7e37447..f02b1f7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,5 +1,7 @@ cmake_minimum_required(VERSION 3.21) +project(yoyo_card) + # C/C++ Standard set(CMAKE_CXX_STANDARD 20) set(CMAKE_CXX_STANDARD_REQUIRED ON) diff --git a/game.cmake b/game.cmake index cd7ad9a..9f8d3f2 100644 --- a/game.cmake +++ b/game.cmake @@ -1,6 +1,6 @@ # Project project( - yoyo_card + game VERSION 1.0.0 DESCRIPTION "Gabo card game recreation." HOMEPAGE_URL "https://www.etheryo.fr" @@ -23,9 +23,15 @@ target_link_libraries(${TARGET} raylib) # Compilation depending on the platform 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() - target_compile_options(${TARGET} PUBLIC -Wall -Wextra -Wpedantic -Werror) + target_compile_options(${TARGET} PRIVATE -Wall -Wextra -Wpedantic -Werror) endif() # Output folder diff --git a/src/main.cpp b/src/main.cpp index 95ff383..b1382f9 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1,5 +1,9 @@ #include +#if defined(_MSC_VER) && !defined(_DEBUG) +#define main WinMain +#endif + int main(void) { const int screenWidth = 800;