From 0463a6fd70e02692cbff375f90fa7fe4fcc37695 Mon Sep 17 00:00:00 2001 From: Zach H Date: Fri, 13 Dec 2024 16:58:46 -0500 Subject: [PATCH] Support Windows Debug Builds (#5242) --- CMakeLists.txt | 10 ++++++---- cockatrice/src/game/cards/card_database_model.cpp | 2 +- vcpkg | 2 +- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 6fdf938ed..8b6af504c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -140,10 +140,12 @@ endif() # Define proper compilation flags if(MSVC) - # Visual Studio: Maximum optimization, disable warning C4251, establish C++17 compatibility - set(CMAKE_CXX_FLAGS_RELEASE "/Ox /MD /wd4251 /Zc:__cplusplus /std:c++17 /permissive- /W4") - # Generate complete debugging information - #set(CMAKE_CXX_FLAGS_DEBUG "/Zi") + # Visual Studio: Disable Warning C4251, C++17 compatibility, Multi-threaded Builds, Warn Detection, Unwind Semantics + set(CMAKE_CXX_FLAGS "/wd4251 /Zc:__cplusplus /std:c++17 /permissive- /W4 /MP /EHsc") + # Visual Studio: Maximum Optimization, Multi-threaded DLL + set(CMAKE_CXX_FLAGS_RELEASE "/Ox /MD") + # Visual Studio: No Optimization, Multi-threaded Debug DLL, Debug Symbols + set(CMAKE_CXX_FLAGS_DEBUG "/Od /MDd /Zi") elseif(CMAKE_COMPILER_IS_GNUCXX) # linux/gcc, bsd/gcc, windows/mingw include(CheckCXXCompilerFlag) diff --git a/cockatrice/src/game/cards/card_database_model.cpp b/cockatrice/src/game/cards/card_database_model.cpp index 81af0f2ae..abfd25128 100644 --- a/cockatrice/src/game/cards/card_database_model.cpp +++ b/cockatrice/src/game/cards/card_database_model.cpp @@ -176,7 +176,7 @@ void CardDatabaseDisplayModel::fetchMore(const QModelIndex &index) int CardDatabaseDisplayModel::rowCount(const QModelIndex &parent) const { - return qMin(QSortFilterProxyModel::rowCount(parent), loadedRowCount); + return QSortFilterProxyModel::rowCount(parent); } bool CardDatabaseDisplayModel::lessThan(const QModelIndex &left, const QModelIndex &right) const diff --git a/vcpkg b/vcpkg index bb1ca2757..8ec31e98f 160000 --- a/vcpkg +++ b/vcpkg @@ -1 +1 @@ -Subproject commit bb1ca2757bca8f8e372a4deb35943828e3b0d155 +Subproject commit 8ec31e98fb07e3f9c2e5b6aed0737a76a693fc72