From 880b7f15139c0676fda489599e104c6a7c698d59 Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Sun, 14 Jul 2024 19:09:13 +0900 Subject: [PATCH] Win32: Pass triplet option to vcpkg --- .github/workflows/windows.yml | 5 +++-- win32/Makefile.sub | 11 ++++++++--- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index be42f797b4..aa72b671a4 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -54,6 +54,7 @@ jobs: env: GITPULLOPTIONS: --no-tags origin ${{ github.ref }} OS_VER: windows-${{ matrix.vs < 2022 && '2019' || matrix.vs }} + VCPKG_DEFAULT_TRIPLET: ${{ matrix.target || 'x64' }}-windows steps: - run: md build @@ -143,7 +144,7 @@ jobs: - name: Install libraries with vcpkg run: | - vcpkg install --triplet x64-windows + vcpkg install working-directory: src env: VCPKG_BINARY_SOURCES: "clear;x-gha,readwrite" @@ -161,7 +162,7 @@ jobs: - name: Configure run: >- ../src/win32/configure.bat --disable-install-doc - --with-opt-dir=D:/a/ruby/ruby/src/vcpkg_installed/x64-windows + --with-opt-dir=D:/a/ruby/ruby/src/vcpkg_installed/%VCPKG_DEFAULT_TRIPLET% - run: nmake prepare-vcpkg diff --git a/win32/Makefile.sub b/win32/Makefile.sub index 2b791c0562..46df464232 100644 --- a/win32/Makefile.sub +++ b/win32/Makefile.sub @@ -594,14 +594,19 @@ $(SCRIPTPROGRAMS): $(STUBPROGRAM) update-src:: @cd "$(srcdir:/=\)" && set LC_TIME=C && $(VCSUP) +!ifndef VCPKG_DEFAULT_TRIPLET +VCPKG_DEFAULT_TRIPLET = $(MACHINE)-windows +!endif +TRIPLET_OPTION = --triplet $(VCPKG_DEFAULT_TRIPLET) + update-vcpkg:: - @cd "$(srcdir:/=\)" && set LC_TIME=C && vcpkg x-update-baseline + @cd "$(srcdir:/=\)" && set LC_TIME=C && vcpkg x-update-baseline $(TRIPLET_OPTION) install-vcpkg:: - @cd "$(srcdir:/=\)" && set LC_TIME=C && vcpkg install + @cd "$(srcdir:/=\)" && set LC_TIME=C && vcpkg install $(TRIPLET_OPTION) prepare-vcpkg:: - for %%I in ($(srcdir:/=\)\vcpkg_installed\x64-windows\bin\*.dll) do ( \ + for %%I in ($(srcdir:/=\)\vcpkg_installed\$(VCPKG_DEFAULT_TRIPLET)\bin\*.dll) do @( \ if not %%~nI == readline mklink %%~nxI %%I \ )