Install Vulkan SDK in generate_xcode_project.command (#678)

This commit is contained in:
vkedwardli 2022-06-30 20:11:26 +08:00 committed by GitHub
parent 44e96c544b
commit a659b57e63
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 10 additions and 0 deletions

View File

@ -18,6 +18,16 @@ fi
if [[ -z "${VULKAN_SDK}" ]]; then if [[ -z "${VULKAN_SDK}" ]]; then
echo 'Warning: VULKAN_SDK is not set in environment variable' echo 'Warning: VULKAN_SDK is not set in environment variable'
read -p "Type y to install Vulkan SDK: " v
if [ $v == "y" ]; then
curl https://sdk.lunarg.com/sdk/download/latest/mac/vulkan-sdk.dmg -o vulkan-sdk.dmg
hdiutil attach ./vulkan-sdk.dmg
/Volumes/vulkansdk-macos-*/InstallVulkan.app/Contents/MacOS/InstallVulkan --root $HOME/VulkanSDK --accept-licenses --default-answer --confirm-command install
hdiutil detach /Volumes/vulkansdk-macos-*
rm ./vulkan-sdk.dmg
echo "export VULKAN_SDK=$HOME/VulkanSDK/macOS" >> ~/.zshrc
echo "VULKAN_SDK is now set in .zshrc (Will be effective after you restart the shell)"
fi
fi fi
cmake -B build -DCMAKE_BUILD_TYPE=Release $option -DCMAKE_XCODE_GENERATE_SCHEME=YES -G "Xcode" cmake -B build -DCMAKE_BUILD_TYPE=Release $option -DCMAKE_XCODE_GENERATE_SCHEME=YES -G "Xcode"