diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a1e04d32f..f38ee6c51 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -15,8 +15,8 @@ env: jobs: - # Windows build - win: + # Windows MINGW build + win_mingw: runs-on: windows-2022 name: ๐ŸชŸ Windows MINGW64 @@ -41,8 +41,8 @@ jobs: uses: hendrikmuhs/ccache-action@v1 id: cache-ccache with: - key: ${{ runner.os }}-ccache-${{ github.run_id }} - restore-keys: ${{ runner.os }}-ccache + key: ${{ runner.os }}-mingw-ccache-${{ github.run_id }} + restore-keys: ${{ runner.os }}-mingw-ccache max-size: 1G - name: ๐ŸŸฆ Install msys2 @@ -178,6 +178,80 @@ jobs: path: | build/install/* + win_msvc: + runs-on: windows-2022 + name: ๐ŸชŸ Windows MSVC + + env: + CCACHE_DIR: "${{ github.workspace }}/.ccache" + + permissions: + id-token: write + attestations: write + + steps: + - name: ๐Ÿงฐ Checkout + uses: actions/checkout@v4 + with: + submodules: recursive + + - name: ๐Ÿซง Setup Visual Studio Dev Environment + uses: ilammy/msvc-dev-cmd@v1 + with: + arch: amd64 + + - name: ๐Ÿ“œ Setup ccache + uses: hendrikmuhs/ccache-action@v1 + id: cache-ccache + with: + key: ${{ runner.os }}-msvc-ccache-${{ github.run_id }} + restore-keys: ${{ runner.os }}-msvc-ccache + max-size: 1G + + - name: ๐Ÿ“ฆ Install vcpkg + uses: friendlyanon/setup-vcpkg@v1 + with: { committish: 7e21420f775f72ae938bdeb5e6068f722088f06a } + + - name: โฌ‡๏ธ Install dependencies + run: | + cp dist/vcpkg.json vcpkg.json + + - name: โฌ‡๏ธ Install CMake and Ninja + uses: lukka/get-cmake@latest + + - name: โฌ‡๏ธ Install .NET + uses: actions/setup-dotnet@v4 + with: + dotnet-version: '8.0.100' + + - name: ๐Ÿ“œ Set version variable + run: | + "IMHEX_VERSION=$(Get-Content VERSION -Raw)" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append + + # Windows cmake build + - name: ๐Ÿ› ๏ธ Configure CMake + run: | + mkdir -p build + + cmake -G "Ninja" -B build ` + --preset vs2022 ` + -DCMAKE_TOOLCHAIN_FILE="$env:VCPKG_ROOT/scripts/buildsystems/vcpkg.cmake" ` + -DCMAKE_C_COMPILER="$($(Get-Command cl.exe).Path)" ` + -DCMAKE_CXX_COMPILER="$($(Get-Command cl.exe).Path)" ` + -DCMAKE_C_COMPILER_LAUNCHER=ccache ` + -DCMAKE_CXX_COMPILER_LAUNCHER=ccache ` + -DCMAKE_BUILD_TYPE="$env:BUILD_TYPE" ` + -DIMHEX_PATTERNS_PULL_MASTER=ON ` + -DIMHEX_COMMIT_HASH_LONG="$env:GITHUB_SHA" ` + -DIMHEX_COMMIT_BRANCH="$($env:GITHUB_REF -replace '.*/', '')" ` + -DDOTNET_EXECUTABLE="C:/Program Files/dotnet/dotnet.exe" ` + . + + - name: ๐Ÿ› ๏ธ Build + run: | + cd build + ninja + win-plugin-template-test: runs-on: windows-2022 name: ๐Ÿงช Plugin Template Test @@ -186,7 +260,7 @@ jobs: run: shell: msys2 {0} - needs: win + needs: win_mingw env: IMHEX_SDK_PATH: "${{ github.workspace }}/out/sdk" diff --git a/.gitignore b/.gitignore index c7c864f22..a199a2d2b 100644 --- a/.gitignore +++ b/.gitignore @@ -16,3 +16,4 @@ CMakeUserPresets.json Brewfile.lock.json .vs/ +vcpkg.json diff --git a/plugins/builtin/source/content/views/view_pattern_editor.cpp b/plugins/builtin/source/content/views/view_pattern_editor.cpp index 1a3025d84..952e12983 100644 --- a/plugins/builtin/source/content/views/view_pattern_editor.cpp +++ b/plugins/builtin/source/content/views/view_pattern_editor.cpp @@ -1425,7 +1425,7 @@ namespace hex::plugin::builtin { const auto &currScope = evaluator->getScope(-m_debuggerScopeIndex); if (ImGui::BeginCombo("##scope", displayValue(currScope.parent, m_debuggerScopeIndex).c_str())) { for (size_t i = 0; i < evaluator->getScopeCount(); i++) { - auto &scope = evaluator->getScope(-i); + auto &scope = evaluator->getScope(-i32(i)); if (ImGui::Selectable(displayValue(scope.parent, i).c_str(), i == size_t(m_debuggerScopeIndex))) { m_debuggerScopeIndex = i;