From 59c1ab453362eeed7e53dfbd48755d305054e440 Mon Sep 17 00:00:00 2001 From: Love Billenius Date: Mon, 29 Jan 2024 16:41:42 +0100 Subject: [PATCH] Prevent terminal from launching on Windows under release --- CMakeLists.txt | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index d723c95..304b0a4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -59,6 +59,13 @@ if (ENABLE_OPTIMIZATIONS) set(CMAKE_FIND_LIBRARY_SUFFIXES ".a") set(CMAKE_EXE_LINKER_FLAGS "-static-libgcc -static-libstdc++") + # Make sure that a terminal window doesn't launch under Windows. + # We will still launch the terminal if we haven't compiled with optimizations. + # This is useful for debugging + if (WIN32) + set_target_properties(Pong PROPERTIES WIN32_EXECUTABLE TRUE) + endif () + if (MSVC) target_compile_options(Pong PRIVATE /O2) else ()