external/meson/UnpackedTarball_meson.mk |   17 +++++++++++++++++
 1 file changed, 17 insertions(+)

New commits:
commit 67ee916d32527ccb6e5aa0930d6aec463e665f3d
Author:     Christian Lohmaier <[email protected]>
AuthorDate: Fri Jan 23 12:24:05 2026 +0100
Commit:     Christian Lohmaier <[email protected]>
CommitDate: Tue Jan 27 14:04:18 2026 +0100

    meson: allow building with the older of two installed versions of VS
    
    meson always queries for the -latest -prerelease version of Visual
    Studio using vswhere, ignoring the selection done in configure. This
    then clashes when trying to build with an older version of the compiler.
    
    That's an obvious hack that only works with the provided version of
    meson and a better fix would be to make that a meson commandline option
    or allow passing it via the ENV/have it guess from CC/CXX or similar.
    
    adjusted for different supported compiler versions on 25-8 branch
    
    Change-Id: I9bcbe26d9b1518b5effbf0be99329b8d2d4a0262
    (cherry picked from commit b1704fca1771c4a6697929461474ede69622c1cf)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/197944
    Tested-by: Jenkins
    Reviewed-by: Christian Lohmaier <[email protected]>

diff --git a/external/meson/UnpackedTarball_meson.mk 
b/external/meson/UnpackedTarball_meson.mk
index 30be47b5eeba..6e5910ac4df3 100644
--- a/external/meson/UnpackedTarball_meson.mk
+++ b/external/meson/UnpackedTarball_meson.mk
@@ -11,4 +11,21 @@ $(eval $(call gb_UnpackedTarball_UnpackedTarball,meson))
 
 $(eval $(call gb_UnpackedTarball_set_tarball,meson,$(MESON_TARBALL)))
 
+ifeq ($(OS),WNT)
+# hack to make meson use a specific VS version and not always the latest
+# (argument is '-latest' so inner quotes to separate the arguments
+# it also always specifies -prerelease, but that is left alone here)
+ifneq ($(filter 17.%,$(VCVER)),)
+meson_vsversion=-version', '[17,18)
+else ifneq ($(filter 16.%,$(VCVER)),)
+meson_vsversion=-version', '[16,17)
+else
+$(warning Warning: Unhandled VCVER '$(VCVER)'; defaulting meson to use latest 
VS version)
+meson_vsversion=-latest
+endif
+
+$(eval $(call gb_UnpackedTarball_set_post_action,meson,\
+    sed -i -e "s/-latest/$(meson_vsversion)/" mesonbuild/utils/vsenv.py \
+))
+endif
 # vim: set noet sw=4 ts=4:

Reply via email to