diff --git a/.github/workflows/build-macos.yml b/.github/workflows/build-macos.yml index 349f99d2..1d4b9171 100644 --- a/.github/workflows/build-macos.yml +++ b/.github/workflows/build-macos.yml @@ -43,6 +43,7 @@ jobs: with: name: macOS-${{ matrix.arch }} path: macOS-${{ matrix.arch }}.zip + retention-days: 1 universal-binary: name: Universal binary @@ -75,10 +76,10 @@ jobs: with: name: macOS-universal path: macOS-universal.zip - - name: Clean up architecture-specific artifacts - uses: geekyeggo/delete-artifact@v4 - with: - failOnError: false - name: | - macOS-x86_64 - macOS-arm64 +# - name: Clean up architecture-specific artifacts +# uses: geekyeggo/delete-artifact@v4 +# with: +# failOnError: false +# name: | +# macOS-x86_64 +# macOS-arm64 diff --git a/src/frontend/duckstation/gl/context.cpp b/src/frontend/duckstation/gl/context.cpp index a0a4183b..308b3c40 100644 --- a/src/frontend/duckstation/gl/context.cpp +++ b/src/frontend/duckstation/gl/context.cpp @@ -3,11 +3,7 @@ #include "loader.h" #include #include -#ifdef __APPLE__ #include -#else -#include -#endif Log_SetChannel(GL::Context); #if defined(_WIN32) diff --git a/src/frontend/qt_sdl/Platform.cpp b/src/frontend/qt_sdl/Platform.cpp index 9bb19d1a..0cd4f615 100644 --- a/src/frontend/qt_sdl/Platform.cpp +++ b/src/frontend/qt_sdl/Platform.cpp @@ -31,6 +31,7 @@ #include #include #include +#include #include #include "Platform.h" @@ -333,13 +334,29 @@ bool LocalFileExists(const std::string& name) bool CheckFileWritable(const std::string& filepath) { - FileHandle* file = Platform::OpenFile(filepath.c_str(), FileMode::Append); + FileHandle* file = Platform::OpenFile(filepath.c_str(), FileMode::Read); + if (file) { + // if the file exists, check if it can be opened for writing. Platform::CloseFile(file); - return true; + file = Platform::OpenFile(filepath.c_str(), FileMode::Append); + if (file) + { + Platform::CloseFile(file); + return true; + } + else return false; + } + else + { + // if the file does not exist, create a temporary file to check, to avoid creating an empty file. + if (QTemporaryFile(filepath.c_str()).open()) + { + return true; + } + else return false; } - else return false; } bool CheckLocalFileWritable(const std::string& name) diff --git a/src/teakra/src/CMakeLists.txt b/src/teakra/src/CMakeLists.txt index b96c500b..30683374 100644 --- a/src/teakra/src/CMakeLists.txt +++ b/src/teakra/src/CMakeLists.txt @@ -32,11 +32,16 @@ add_library(teakra register.h shared_memory.h teakra.cpp - test.h - test_generator.cpp - test_generator.h ) +if (TEAKRA_BUILD_UNIT_TESTS) + target_sources(teakra PUBLIC + test.h + test_generator.cpp + test_generator.h + ) +endif() + create_target_directory_groups(teakra) target_link_libraries(teakra PRIVATE Threads::Threads)