so I've been developing an application in debug for a little while and I've come to the point where I need to check the release status, so I did a little research and found out how to use CMake's build types (I'm kinda new to CMake so bear with me). Basically I use:
cmake -DCMAKE_BUILD_TYPE=Release .. -G Ninja
But for some reason, the console (which I only use for logging) is still opening. How can I avoid this? I mean, I'm using GLFW to create a window, and I only want that window opening, not the console. Ideally, the console would only open in debug builds, but I don't know how to achieve this, is there some sort of compiler flag? I'm using Clang btw.
Here's the CMakeLists.txt:
CMAKE_MINIMUM_REQUIRED(VERSION 3.21)
SET(CMAKE_EXPORT_COMPILE_COMMANDS ON)
SET(CMAKE_CXX_STANDARD 20)
SET(CMAKE_CXX_STANDARD_REQUIRED ON)
PROJECT(App VERSION 1.0.0)
# Engine
ADD_LIBRARY(engine
src/engine/graphics.cpp
)
TARGET_INCLUDE_DIRECTORIES(engine PUBLIC src/engine)
# Vulkan
FIND_PACKAGE(Vulkan REQUIRED)
TARGET_INCLUDE_DIRECTORIES(engine PUBLIC ${Vulkan_INCLUDE_DIRS})
TARGET_LINK_LIBRARIES(engine ${Vulkan_LIBRARIES})
# GLFW
SET(GLFW_BUILD_DOCS OFF CACHE BOOL "" FORCE)
SET(GLFW_BUILD_TESTS OFF CACHE BOOL "" FORCE)
SET(GLFW_BUILD_EXAMPLES OFF CACHE BOOL "" FORCE)
ADD_SUBDIRECTORY(dependencies/glfw)
TARGET_LINK_LIBRARIES(engine glfw)
# Executable
ADD_EXECUTABLE(app src/main.cpp)
TARGET_LINK_LIBRARIES(app engine)