From 7165605c9453df3676ab0993d9bfabed277dfcba Mon Sep 17 00:00:00 2001 From: Krzysztof Hrynczenko Date: Tue, 8 Nov 2022 20:12:57 +0100 Subject: [PATCH] build: use /SUBSYSTEM:WINDOWS on all build types ${CMAKE_BUILD_TYPE} was empty when project was opened/used from things like visual studio code which is multi-build-type configuration. --- CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 0f66388..980b687 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -86,8 +86,8 @@ target_link_libraries(RadioStream PRIVATE ${FONTCONFIG_LIB} ${PTHREAD_LIB}) -if (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC" AND CMAKE_BUILD_TYPE STREQUAL "Release") - target_link_options(RadioStream BEFORE PRIVATE "/SUBSYSTEM:WINDOWS" "/ENTRY:WinMainCRTStartup") +if (${CMAKE_CXX_COMPILER_ID} STREQUAL MSVC) + target_link_options(RadioStream PRIVATE "/SUBSYSTEM:WINDOWS") endif() if (${CMAKE_CXX_COMPILER_ID} STREQUAL MSVC)