From 65705d82f374630e5c85f9fc4127ae21d88f3ed0 Mon Sep 17 00:00:00 2001 From: Nexoniarz Date: Mon, 19 Oct 2026 22:11:08 +0200 Subject: [PATCH] Builds: file times without to_sys (Windows), no C++ module scan (Android on GitHub) Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01NMSrd5oe1GpUD7E6d825KP --- CMakeLists.txt | 1 + src/app.cpp | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 8413d35..6c4a0e8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,5 +1,6 @@ cmake_minimum_required(VERSION 3.25) project(Fry3DX VERSION 0.5.0 LANGUAGES C CXX) +set(CMAKE_CXX_SCAN_FOR_MODULES OFF) # (no C++ modules; the scan can pick up a different clang than the NDK's) if(UNIX AND NOT APPLE) add_link_options(-rdynamic) # function names in crash reports endif() diff --git a/src/app.cpp b/src/app.cpp index cca894e..a1a75cb 100644 --- a/src/app.cpp +++ b/src/app.cpp @@ -1125,8 +1125,8 @@ private: std::getline(in, from); std::error_code ec; // (in local time: through time_t, as not every C++ library has time zones yet) - const std::time_t t = std::chrono::system_clock::to_time_t( - std::chrono::time_point_cast(stdfs::file_time_type::clock::to_sys(stdfs::last_write_time(f, ec)))); + const auto age = stdfs::file_time_type::clock::now() - stdfs::last_write_time(f, ec); // (file clocks differ by library: by age) + const std::time_t t = std::chrono::system_clock::to_time_t(std::chrono::system_clock::now() - std::chrono::duration_cast(age)); std::tm local{}; #if defined(_WIN32) localtime_s(&local, &t);