From a3eb0572159f946c10fc9350ca11ff46f4fdfadb Mon Sep 17 00:00:00 2001 From: WerWolv Date: Tue, 22 Jul 2025 23:47:24 +0200 Subject: [PATCH] build: Allow ccache to properly cache msvc builds --- CMakeLists.txt | 2 +- cmake/build_helpers.cmake | 5 +++++ plugins/builtin/source/content/views/view_pattern_editor.cpp | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index d85058620..c81121bdd 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.20) +cmake_minimum_required(VERSION 3.25) # Options option(IMHEX_PLUGINS_IN_SHARE "Put the plugins in share/imhex/plugins instead of lib[..]/imhex/plugins (Linux only)" OFF) diff --git a/cmake/build_helpers.cmake b/cmake/build_helpers.cmake index 42fcb0c2c..42913f517 100644 --- a/cmake/build_helpers.cmake +++ b/cmake/build_helpers.cmake @@ -4,6 +4,7 @@ set(CMAKE_POLICY_DEFAULT_CMP0077 NEW) set(CMAKE_POLICY_DEFAULT_CMP0063 NEW) +set(CMAKE_POLICY_DEFAULT_CMP0141 NEW) if (POLICY CMP0177) set(CMAKE_POLICY_DEFAULT_CMP0177 OLD) @@ -429,6 +430,10 @@ macro(configureCMake) set(CMAKE_POSITION_INDEPENDENT_CODE ON CACHE BOOL "Enable position independent code for all targets" FORCE) + if (MSVC) + set(CMAKE_MSVC_DEBUG_INFORMATION_FORMAT "$<$:Embedded>") + endif() + # Configure use of recommended build tools if (IMHEX_USE_DEFAULT_BUILD_SETTINGS) message(STATUS "Configuring CMake to use recommended build tools...") diff --git a/plugins/builtin/source/content/views/view_pattern_editor.cpp b/plugins/builtin/source/content/views/view_pattern_editor.cpp index 81c30e570..09eb1333f 100644 --- a/plugins/builtin/source/content/views/view_pattern_editor.cpp +++ b/plugins/builtin/source/content/views/view_pattern_editor.cpp @@ -2737,11 +2737,11 @@ namespace hex::plugin::builtin { if (!std::filesystem::exists(fileInfo.path)) { return false; } + return std::filesystem::last_write_time(fileInfo.path) != fileInfo.lastModified; } catch (const std::filesystem::filesystem_error &) { return false; } - return false; } size_t ViewPatternEditor::calculateContentHash(const std::string &content) const {