build: Allow ccache to properly cache msvc builds

This commit is contained in:
WerWolv
2025-07-22 23:47:24 +02:00
parent 59695dcad6
commit a3eb057215
3 changed files with 7 additions and 2 deletions

View File

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

View File

@@ -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 "$<$<CONFIG:Debug,RelWithDebInfo>:Embedded>")
endif()
# Configure use of recommended build tools
if (IMHEX_USE_DEFAULT_BUILD_SETTINGS)
message(STATUS "Configuring CMake to use recommended build tools...")

View File

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