Check build types properly (for multi-config)

This commit is contained in:
Nadia Holmquist Pedersen 2022-05-04 14:51:01 +02:00
parent 43f23472c3
commit ab5657512e
2 changed files with 5 additions and 7 deletions

View File

@ -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)

View File

@ -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 $<CONFIG:Release>)
endif()
if (PORTABLE)