diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index b55b539..e73ef4b 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -176,6 +176,13 @@ jobs: cmake -B ${{ steps.strings.outputs.build-output-dir }}-qtkeychain -DCMAKE_PREFIX_PATH=${{ steps.strings.outputs.prefix-dir }} -DCMAKE_CXX_COMPILER=${{ matrix.cpp_compiler }} -DCMAKE_C_COMPILER=${{ matrix.c_compiler }} -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -S qtkeychain -DCMAKE_INSTALL_PREFIX=${{ steps.strings.outputs.prefix-dir }} -DBUILD_TESTING=OFF -DBUILD_WITH_QT6=ON cmake --build ${{ steps.strings.outputs.build-output-dir }}-qtkeychain --config ${{ matrix.build_type }} --target install + - name: Build unshield + if: steps.cache-prefix-restore.outputs.cache-hit != 'true' + run: | + git clone https://github.com/twogood/unshield.git + cmake -B ${{ steps.strings.outputs.build-output-dir }}-unshield -DCMAKE_PREFIX_PATH=${{ steps.strings.outputs.prefix-dir }} -DCMAKE_CXX_COMPILER=${{ matrix.cpp_compiler }} -DCMAKE_C_COMPILER=${{ matrix.c_compiler }} -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -S unshield -DCMAKE_INSTALL_PREFIX=${{ steps.strings.outputs.prefix-dir }} -DBUILD_TESTING=OFF + cmake --build ${{ steps.strings.outputs.build-output-dir }}-unshield --config ${{ matrix.build_type }} --target install + - name: Save Prefix id: cache-prefix-save uses: actions/cache/save@v4 diff --git a/external/CMakeLists.txt b/external/CMakeLists.txt index 43611c9..dad4f48 100644 --- a/external/CMakeLists.txt +++ b/external/CMakeLists.txt @@ -18,8 +18,13 @@ add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/libphysis/logger EXCLUDE_FROM_ALL) target_include_directories(physis INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}/libphysis/target/public) -# TODO: enable unshield on Windows -if (NOT WIN32) +# We should use the CMake module everywhere once distros update their packages +if (WIN32) + # FIXME: unshield should include zlib in their upstream cmake + find_package(ZLIB REQUIRED) + find_package(unshield REQUIRED) + target_link_libraries(physis INTERFACE unshield::libunshield) +else() find_package(PkgConfig REQUIRED) pkg_check_modules(UNSHIELD REQUIRED IMPORTED_TARGET libunshield) target_link_directories(physis INTERFACE ${UNSHIELD_LIBRARY_DIRS}) diff --git a/scripts/windows-setup.ps1 b/scripts/windows-setup.ps1 index 74b3805..d7e86f3 100644 --- a/scripts/windows-setup.ps1 +++ b/scripts/windows-setup.ps1 @@ -125,4 +125,10 @@ CheckCompileResult "qcoro" Clone "qtkeychain" "https://github.com/frankosterfeld/qtkeychain.git" Configure "qtkeychain" "-DBUILD_TESTING=OFF -DBUILD_WITH_QT6=ON" cmake --build "$BuildDir-qtkeychain" --config Debug --target install --parallel $NumCores -CheckCompileResult "qtkeychain" \ No newline at end of file +CheckCompileResult "qtkeychain" + +# Build unshield +Clone "unshield" "https://github.com/twogood/unshield.git" +Configure "unshield" "-DBUILD_TESTING=OFF" +cmake --build "$BuildDir-unshield" --config Debug --target install --parallel $NumCores +CheckCompileResult "unshield" \ No newline at end of file