Skip to content

Commit afdc200

Browse files
authored
Update vulkan_prebuilt_helpers.sh
1 parent 8b1b4a1 commit afdc200

File tree

1 file changed

+26
-1
lines changed

1 file changed

+26
-1
lines changed

vulkan_prebuilt_helpers.sh

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,35 @@ function install_linux() {
4545
tar -C "$VULKAN_SDK" --strip-components 2 -xf vulkan_sdk.tar.gz $VULKAN_SDK_VERSION/x86_64
4646
}
4747

48-
function install_windows() {
48+
# newer SDK installers apparently need to be executed (7z only sees Bin/)
49+
function _install_windows_qt() {
50+
test -d $VULKAN_SDK && test -f vulkan_sdk.exe
51+
echo "Executing Vulkan SDK installer headlessly to $VULKAN_SDK..." >&2
52+
./vulkan_sdk.exe --root "$VULKAN_SDK" --accept-licenses --default-answer --confirm-command install
53+
}
54+
# older SDK installers could be reliably extracteed via 7z.exe
55+
function _install_windows_7z() {
4956
test -d $VULKAN_SDK && test -f vulkan_sdk.exe
57+
echo "Using 7z to unpack Vulkan SDK installer headlessly to $VULKAN_SDK..." >&2
5058
7z x vulkan_sdk.exe -aoa -o$VULKAN_SDK
5159
}
60+
# FIXME: to avoid breaking those using "older" SDKs this checks 7z viability
61+
# and delegates accordingly
62+
function install_windows() {
63+
test -d $VULKAN_SDK && test -f vulkan_sdk.exe
64+
if [[ 7z l vulkan_sdk.exe | grep Include/ >/dev/null ]] ; then
65+
_install_windows_7z
66+
else
67+
_install_windows_qt
68+
fi
69+
# Verify that the installation was successful by checking for a key directory
70+
if [ ! -d "$VULKAN_SDK/Include" ]; then
71+
echo "Installer did not create the expected Include directory." >&2
72+
# You can add more detailed logging here, like listing the contents of VULKAN_SDK
73+
ls -l "$VULKAN_SDK" >&2
74+
exit 1
75+
fi
76+
}
5277

5378
function install_mac() {
5479
test -d $VULKAN_SDK && test -f vulkan_sdk.zip

0 commit comments

Comments
 (0)