diff --git a/CMakeLists.txt b/CMakeLists.txt index 10302391..31f37648 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -37,8 +37,9 @@ else() set(MELONDS_VERSION_PATCH 0) endif() -if (NOT CMAKE_BUILD_TYPE) - set(CMAKE_BUILD_TYPE Release) +if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) + set(CMAKE_BUILD_TYPE Release CACHE STRING "Choose the type of build." FORCE) + set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release" "MinSizeRel" "RelWithDebInfo") endif() function(detect_architecture symbol arch) diff --git a/src/frontend/qt_sdl/CMakeLists.txt b/src/frontend/qt_sdl/CMakeLists.txt index 30cc50e4..850d4194 100644 --- a/src/frontend/qt_sdl/CMakeLists.txt +++ b/src/frontend/qt_sdl/CMakeLists.txt @@ -82,11 +82,7 @@ fix_interface_includes(PkgConfig::SDL2 PkgConfig::Slirp PkgConfig::LibArchive) add_compile_definitions(ARCHIVE_SUPPORT_ENABLED) -if (WIN32 AND (CMAKE_BUILD_TYPE STREQUAL Release)) - add_executable(melonDS WIN32 ${SOURCES_QT_SDL}) -else() - add_executable(melonDS ${SOURCES_QT_SDL}) -endif() +add_executable(melonDS ${SOURCES_QT_SDL}) if (BUILD_STATIC) qt_import_plugins(melonDS INCLUDE Qt::QSvgPlugin) @@ -113,6 +109,7 @@ elseif (WIN32) target_sources(melonDS PUBLIC "${CMAKE_SOURCE_DIR}/melon.rc") target_link_libraries(melonDS PRIVATE ws2_32 iphlpapi) + set_target_properties(melonDS PROPERTIES WIN32_EXECUTABLE $) endif() if (PORTABLE)