From acf2322ff277789b3d6412c4ec59186a865b6ab7 Mon Sep 17 00:00:00 2001 From: Bruno Alexandre Rosa <1791393+brunoalr@users.noreply.github.com> Date: Mon, 2 Mar 2026 23:46:56 -0300 Subject: [PATCH] try to fix fatal error C1041: cannot open program database --- .ci/compile.sh | 6 ++++-- CMakeLists.txt | 3 ++- cockatrice/src/main.cpp | 2 -- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/.ci/compile.sh b/.ci/compile.sh index 8ccf5622b..e8e71c738 100755 --- a/.ci/compile.sh +++ b/.ci/compile.sh @@ -128,9 +128,11 @@ if [[ $MAKE_TEST ]]; then flags+=("-DTEST=1") fi if [[ $USE_CCACHE ]]; then - flags+=("-DUSE_CCACHE=1") if [[ $CCACHE_VARIANT ]]; then - flags+=("-DCMAKE_C_COMPILER_LAUNCHER=$CCACHE_VARIANT" "-DCMAKE_CXX_COMPILER_LAUNCHER=$CCACHE_VARIANT") + # COMPILER_LAUNCHER only; USE_CCACHE=OFF prevents RULE_LAUNCH_COMPILE (avoids Strawberry ccache on Windows) + flags+=("-DUSE_CCACHE=OFF" "-DCMAKE_C_COMPILER_LAUNCHER=$CCACHE_VARIANT" "-DCMAKE_CXX_COMPILER_LAUNCHER=$CCACHE_VARIANT") + else + flags+=("-DUSE_CCACHE=1") fi if [[ $CCACHE_SIZE && "$CCACHE_VARIANT" != "sccache" ]]; then # note, this setting persists after running the script diff --git a/CMakeLists.txt b/CMakeLists.txt index fa9ea75f7..5454469ee 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -144,7 +144,8 @@ endif() # Define proper compilation flags if(MSVC) # Disable Warning C4251, C++20 compatibility, Multi-threaded Builds, Warn Detection, Unwind Semantics, Debug Symbols - set(CMAKE_CXX_FLAGS "/wd4251 /Zc:__cplusplus /std:c++20 /permissive- /W4 /MP /EHsc /Zi") + # /FS: Allow concurrent PDB writes (required for Ninja + /MP parallel builds) + set(CMAKE_CXX_FLAGS "/wd4251 /Zc:__cplusplus /std:c++20 /permissive- /W4 /MP /EHsc /Zi /FS") # Visual Studio: Maximum Optimization, Multi-threaded DLL set(CMAKE_CXX_FLAGS_RELEASE "/Ox /MD") # Visual Studio: No Optimization, Multi-threaded Debug DLL diff --git a/cockatrice/src/main.cpp b/cockatrice/src/main.cpp index 02b06147e..7092a3fd7 100644 --- a/cockatrice/src/main.cpp +++ b/cockatrice/src/main.cpp @@ -214,7 +214,6 @@ int main(int argc, char *argv[]) #endif #ifdef Q_OS_MAC - translationPath = qApp->applicationDirPath() + "/../Resources/translations"; #elif defined(Q_OS_WIN) translationPath = qApp->applicationDirPath() + "/translations"; @@ -238,7 +237,6 @@ int main(int argc, char *argv[]) } rng = new RNG_SFMT; - const auto bla = 42; themeManager = new ThemeManager; soundEngine = new SoundEngine;