From f94c03339f6be8d6a35d6790424cfb2ce4eda3c6 Mon Sep 17 00:00:00 2001 From: Kelsi Date: Wed, 13 May 2026 11:01:36 -0700 Subject: [PATCH] fix(ci): link glm in test_camera; widen fopen() path on Windows MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit test_camera was the only Catch2 target missing the `if(TARGET glm::glm)` link block — every other test linked glm but this one didn't, so the macOS arm64 builder failed to find `glm/glm.hpp` from camera.hpp. Five fopen call sites in tools/editor/cli_* passed fs::directory_entry::path().c_str() — that's wchar_t* on Windows. Routed them through `.string().c_str()` so MSYS2 GCC and clang both accept the const char* parameter. --- tests/CMakeLists.txt | 3 +++ tools/editor/cli_audits.cpp | 4 ++-- tools/editor/cli_project_inventory.cpp | 2 +- tools/editor/cli_readmes.cpp | 2 +- tools/editor/cli_zone_inventory.cpp | 2 +- 5 files changed, 8 insertions(+), 5 deletions(-) diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 1e8c7e03..14b82e04 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -456,6 +456,9 @@ add_executable(test_camera target_include_directories(test_camera PRIVATE ${TEST_INCLUDE_DIRS}) target_include_directories(test_camera SYSTEM PRIVATE ${TEST_SYSTEM_INCLUDE_DIRS}) target_link_libraries(test_camera PRIVATE catch2_main) +if(TARGET glm::glm) + target_link_libraries(test_camera PRIVATE glm::glm) +endif() add_test(NAME camera COMMAND test_camera) register_test_target(test_camera) diff --git a/tools/editor/cli_audits.cpp b/tools/editor/cli_audits.cpp index 559d3c1f..660e5058 100644 --- a/tools/editor/cli_audits.cpp +++ b/tools/editor/cli_audits.cpp @@ -211,7 +211,7 @@ int handleValidateZonePack(int& i, int argc, char** argv) { if (e.path().extension() != ".png") continue; tex.count++; tex.bytes += e.file_size(); - FILE* f = std::fopen(e.path().c_str(), "rb"); + FILE* f = std::fopen(e.path().string().c_str(), "rb"); if (f) { unsigned char sig[8]; bool ok = (std::fread(sig, 1, 8, f) == 8 && @@ -253,7 +253,7 @@ int handleValidateZonePack(int& i, int argc, char** argv) { if (e.path().extension() != ".wav") continue; audio.count++; audio.bytes += e.file_size(); - FILE* f = std::fopen(e.path().c_str(), "rb"); + FILE* f = std::fopen(e.path().string().c_str(), "rb"); if (f) { char hdr[12]; bool ok = (std::fread(hdr, 1, 12, f) == 12 && diff --git a/tools/editor/cli_project_inventory.cpp b/tools/editor/cli_project_inventory.cpp index f288bc76..1fe5944a 100644 --- a/tools/editor/cli_project_inventory.cpp +++ b/tools/editor/cli_project_inventory.cpp @@ -267,7 +267,7 @@ int handleProjectAudio(int& i, int argc, char** argv) { if (e.path().extension() != ".wav") continue; r.wavCount++; r.bytes += e.file_size(); - FILE* f = std::fopen(e.path().c_str(), "rb"); + FILE* f = std::fopen(e.path().string().c_str(), "rb"); if (f) { char hdr[44]; if (std::fread(hdr, 1, 44, f) == 44 && diff --git a/tools/editor/cli_readmes.cpp b/tools/editor/cli_readmes.cpp index 0f6d35cf..778e13d1 100644 --- a/tools/editor/cli_readmes.cpp +++ b/tools/editor/cli_readmes.cpp @@ -155,7 +155,7 @@ int handleZoneReadme(int& i, int argc, char** argv) { if (e.path().extension() != ".wav") continue; AudRow r{fs::relative(e.path(), zoneDir).string(), e.file_size(), 0, 0.0f}; - FILE* f = std::fopen(e.path().c_str(), "rb"); + FILE* f = std::fopen(e.path().string().c_str(), "rb"); if (f) { char hdr[44]; if (std::fread(hdr, 1, 44, f) == 44 && diff --git a/tools/editor/cli_zone_inventory.cpp b/tools/editor/cli_zone_inventory.cpp index bd770579..2e30c361 100644 --- a/tools/editor/cli_zone_inventory.cpp +++ b/tools/editor/cli_zone_inventory.cpp @@ -159,7 +159,7 @@ int handleZoneAudio(int& i, int argc, char** argv) { Row r; r.path = fs::relative(e.path(), zoneDir).string(); r.bytes = static_cast(e.file_size()); - FILE* f = std::fopen(e.path().c_str(), "rb"); + FILE* f = std::fopen(e.path().string().c_str(), "rb"); if (f) { char hdr[44]; if (std::fread(hdr, 1, 44, f) == 44 &&