From 120098fd1fb8e7ed5cfd32b410df6c1fa0d7ca50 Mon Sep 17 00:00:00 2001 From: Bruno Lopes Date: Fri, 15 Aug 2025 21:23:27 -0300 Subject: [PATCH] meson: Do not check for DirectX SDK in hardcoded MSVC dirs MSYS2 provides the same needed library so let's just find it properly. Note: even when we do have MSVC support we should never hardcode .build files. Setting paths to be searched on MSVC is the job of LIB env var. (cherry picked from commit 634dd304d75a27c6bee8ce0f67d19357041ce7d7) --- build/windows/2_build-gimp-msys2.ps1 | 6 +++--- meson.build | 18 +----------------- meson_options.txt | 1 - 3 files changed, 4 insertions(+), 21 deletions(-) diff --git a/build/windows/2_build-gimp-msys2.ps1 b/build/windows/2_build-gimp-msys2.ps1 index 8879079902..500d655bac 100644 --- a/build/windows/2_build-gimp-msys2.ps1 +++ b/build/windows/2_build-gimp-msys2.ps1 @@ -43,9 +43,9 @@ Write-Output "$([char]27)[0Ksection_start:$(Get-Date -UFormat %s -Millisecond 0) if (-not (Test-Path _build-$MSYSTEM_PREFIX\build.ninja -Type Leaf)) { #FIXME: There is no GJS for Windows. See: https://gitlab.gnome.org/GNOME/gimp/-/issues/5891 - meson setup _build-$MSYSTEM_PREFIX -Dprefix="$GIMP_PREFIX" -Djavascript=disabled ` - -Ddirectx-sdk-dir="$MSYS_ROOT/$MSYSTEM_PREFIX" -Denable-default-bin=enabled ` - -Dbuild-id='org.gimp.GIMP_official' $INSTALLER_OPTION $STORE_OPTION $PKGCONF_RELOCATABLE_OPTION $NON_RELOCATABLE_OPTION + meson setup _build-$MSYSTEM_PREFIX -Dprefix="$GIMP_PREFIX" $NON_RELOCATABLE_OPTION ` + $INSTALLER_OPTION $STORE_OPTION $PKGCONF_RELOCATABLE_OPTION ` + -Denable-default-bin=enabled -Dbuild-id='org.gimp.GIMP_official' } Set-Location _build-$MSYSTEM_PREFIX ninja diff --git a/meson.build b/meson.build index 885dc8fee8..ce012fd028 100644 --- a/meson.build +++ b/meson.build @@ -1005,23 +1005,7 @@ conf.set('HAVE_LIBGUDEV', gudev.found()) # DirectX DirectInput -directx = no_dep -directx_sdk_path = get_option('directx-sdk-dir') -if directx_sdk_path != '' and platform_windows - if directx_sdk_path.contains(' ') or directx_sdk_path.contains('\\') - error('\n'.join([ - 'The DirectX SDK path should be given :', - '* without spaces (use MSys mounts)', - '* with plain (forward) slashes only,' - ])) - endif - - directx = declare_dependency( - dependencies: cc.find_library('dxguid', - dirs: directx_sdk_path / 'Lib' / 'x86'), - include_directories: directx_sdk_path / 'Include', - ) -endif +directx = platform_windows ? cc.find_library('dxguid') : no_dep conf.set('HAVE_DX_DINPUT', directx.found()) cfitsio_dep = dependency('cfitsio', required: get_option('fits')) diff --git a/meson_options.txt b/meson_options.txt index 8c365f1b70..1266292337 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -23,7 +23,6 @@ option('check-update', type: 'combo', value: 'platform-default', option('bug-report-url', type: 'string', value: '', description: 'URL used by the debug dialog to report bugs') option('gimpdir', type: 'string', value: '', description: 'Change default gimpdir from ~/.config/GIMP/3.0 to ~/.config/DIR/3.0 (if relative), or to DIR (if absolute)') option('icc-directory', type: 'string', value: '', description: 'Path to default color profiles for this system') -option('directx-sdk-dir', type: 'string', value: '', description: 'Prefix where the DirectX SDK is installed(optional)') option('with-sendmail', type: 'string', value: '', description: 'Use Sendmail instead of Xdg-email') option('win32-32bits-dll-folder', type: 'string', value: '32/bin', description: 'alternative folder with 32-bit versions of DLL libraries on Windows')