From a94f90ae2c6b05c904f2430edc92b0635eee57d5 Mon Sep 17 00:00:00 2001 From: nikitalita <69168929+nikitalita@users.noreply.github.com> Date: Fri, 27 Jan 2023 18:56:10 -0800 Subject: [PATCH 1/4] Fix compile on windows with clang --- CMakeLists.txt | 6 +++++- ISArchiveV3.cpp | 6 +++++- main.cpp | 4 ++-- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 1731151..29a3db6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -21,5 +21,9 @@ add_executable (unshieldv3 ISArchiveV3.cpp blast.c ) -target_link_libraries(unshieldv3 stdc++fs) + +target_link_libraries(unshieldv3) +if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU") + target_link_libraries(stdc++fs) +endif() install(TARGETS unshieldv3) diff --git a/ISArchiveV3.cpp b/ISArchiveV3.cpp index eb22871..1f08616 100644 --- a/ISArchiveV3.cpp +++ b/ISArchiveV3.cpp @@ -17,6 +17,8 @@ limitations under the License. #include "ISArchiveV3.h" #include #include +#include +#include #include #include extern "C" { @@ -111,8 +113,10 @@ std::tm ISArchiveV3::File::tm() const { std::filesystem::path ISArchiveV3::File::path() const { std::string fp = full_path; + // windows paths are wchar_t, convert + char pref_seperator = fs::path::preferred_separator; std::replace(fp.begin(), fp.end(), - '\\', fs::path::preferred_separator); + '\\', pref_seperator); return std::filesystem::path(fp); } diff --git a/main.cpp b/main.cpp index fcfd859..67e2b9e 100644 --- a/main.cpp +++ b/main.cpp @@ -44,7 +44,7 @@ void info(const ISArchiveV3& archive) { } } -void list(const ISArchiveV3& archive, bool verbose = false) { +void list_archive(const ISArchiveV3& archive, bool verbose = false) { size_t max_path = 0; if (verbose) { for (auto& f : archive.files()) { @@ -161,7 +161,7 @@ int cmd_list(deque subargs) { return 1; } ISArchiveV3 archive(apath); - list(archive, verbose); + list_archive(archive, verbose); return 0; } From c1d2beb25eeda327b2eb2c1fa7c73ca08131e160 Mon Sep 17 00:00:00 2001 From: nikitalita <69168929+nikitalita@users.noreply.github.com> Date: Tue, 7 Feb 2023 21:17:25 -0800 Subject: [PATCH 2/4] update gitignore --- .gitignore | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.gitignore b/.gitignore index fe3b15e..8141bd4 100644 --- a/.gitignore +++ b/.gitignore @@ -108,3 +108,12 @@ Thumbs.db # Build directory # --------------- build/* + +# generated config +config.h + +# clangd cache +.cache/ + +# VScode IDE files +.vscode/ From d25a0e27aefea2289afc309f838c3da824552cd7 Mon Sep 17 00:00:00 2001 From: Mike Yin Date: Sun, 6 Apr 2025 21:29:48 -0600 Subject: [PATCH 3/4] Don't require linking to `stdc++fs` for GNU either --- CMakeLists.txt | 3 --- 1 file changed, 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 29a3db6..4a9e061 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -23,7 +23,4 @@ add_executable (unshieldv3 ) target_link_libraries(unshieldv3) -if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU") - target_link_libraries(stdc++fs) -endif() install(TARGETS unshieldv3) From 92e84aff6be5fd134f79ec259ea30412283389cd Mon Sep 17 00:00:00 2001 From: Mike Yin Date: Sun, 6 Apr 2025 22:32:57 -0600 Subject: [PATCH 4/4] Update workflow action --- .github/workflows/cmake.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index f066974..2ebb7e1 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -18,7 +18,7 @@ jobs: runs-on: ubuntu-20.04 steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Print env run: | @@ -40,7 +40,7 @@ jobs: # See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail run: ctest -C ${{env.BUILD_TYPE}} - - uses: actions/upload-artifact@v3 + - uses: actions/upload-artifact@v4 with: name: unshieldv3.x86_64 path: ${{github.workspace}}/build/unshieldv3