Skip to content

Commit

Permalink
Fixed build with recent Vulkan SDK tarballs.
Browse files Browse the repository at this point in the history
  • Loading branch information
chrismile committed Aug 24, 2023
1 parent 33ac8da commit 5dc6bbf
Show file tree
Hide file tree
Showing 6 changed files with 46 additions and 28 deletions.
14 changes: 8 additions & 6 deletions .github/workflows/build-brew.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,12 +80,14 @@ jobs:
source "VulkanSDK/$(ls VulkanSDK)/setup-env.sh"
# Fix pkgconfig file.
shaderc_pkgconfig_file="VulkanSDK/$(ls VulkanSDK)/$os_arch/lib/pkgconfig/shaderc.pc"
prefix_path=$(realpath "VulkanSDK/$(ls VulkanSDK)/$os_arch")
#sed -i '3s;.*;prefix=\"'$prefix_path'\";' "$shaderc_pkgconfig_file"
#sed -i '5s;.*;libdir=${prefix}/lib;' "$shaderc_pkgconfig_file"
sed -i '' 's;^prefix=.*;prefix=\"'$prefix_path'\";' "$shaderc_pkgconfig_file"
sed -i '' 's;^libdir=.*;libdir=${prefix}/lib;' "$shaderc_pkgconfig_file"
export PKG_CONFIG_PATH="$(realpath "VulkanSDK/$(ls VulkanSDK)/$os_arch/lib/pkgconfig")"
if [ -f $shaderc_pkgconfig_file ]; then
prefix_path=$(realpath "VulkanSDK/$(ls VulkanSDK)/$os_arch")
#sed -i '3s;.*;prefix=\"'$prefix_path'\";' "$shaderc_pkgconfig_file"
#sed -i '5s;.*;libdir=${prefix}/lib;' "$shaderc_pkgconfig_file"
sed -i '' 's;^prefix=.*;prefix=\"'$prefix_path'\";' "$shaderc_pkgconfig_file"
sed -i '' 's;^libdir=.*;libdir=${prefix}/lib;' "$shaderc_pkgconfig_file"
export PKG_CONFIG_PATH="$(realpath "VulkanSDK/$(ls VulkanSDK)/$os_arch/lib/pkgconfig")"
fi
fi
elif [ "$RUNNER_OS" == "macOS" ]; then
vulkansdk_filename=$(curl -sIkL https://sdk.lunarg.com/sdk/download/latest/mac/vulkan-sdk.dmg | sed -r '/filename=/!d;s/.*filename=(.*)$/\1/')
Expand Down
10 changes: 6 additions & 4 deletions .github/workflows/build-ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,12 @@ jobs:
tar -xf vulkan-sdk.tar.gz -C VulkanSDK
# Fix pkgconfig file.
shaderc_pkgconfig_file="VulkanSDK/$(ls VulkanSDK)/$os_arch/lib/pkgconfig/shaderc.pc"
prefix_path=$(realpath "VulkanSDK/$(ls VulkanSDK)/$os_arch")
sed -i '3s;.*;prefix=\"'$prefix_path'\";' "$shaderc_pkgconfig_file"
sed -i '5s;.*;libdir=${prefix}/lib;' "$shaderc_pkgconfig_file"
echo "PKG_CONFIG_PATH=\"$(realpath "VulkanSDK/$(ls VulkanSDK)/$os_arch/lib/pkgconfig")\"" >> $GITHUB_ENV
if [ -f $shaderc_pkgconfig_file ]; then
prefix_path=$(realpath "VulkanSDK/$(ls VulkanSDK)/$os_arch")
sed -i '3s;.*;prefix=\"'$prefix_path'\";' "$shaderc_pkgconfig_file"
sed -i '5s;.*;libdir=${prefix}/lib;' "$shaderc_pkgconfig_file"
echo "PKG_CONFIG_PATH=\"$(realpath "VulkanSDK/$(ls VulkanSDK)/$os_arch/lib/pkgconfig")\"" >> $GITHUB_ENV
fi
fi
- name: Download Embree
Expand Down
10 changes: 6 additions & 4 deletions .github/workflows/build-vcpkg.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,10 +85,12 @@ jobs:
tar -xf vulkan-sdk.tar.gz -C VulkanSDK
# Fix pkgconfig file.
shaderc_pkgconfig_file="VulkanSDK/$(ls VulkanSDK)/$os_arch/lib/pkgconfig/shaderc.pc"
prefix_path=$(realpath "VulkanSDK/$(ls VulkanSDK)/$os_arch")
sed -i '3s;.*;prefix=\"'$prefix_path'\";' "$shaderc_pkgconfig_file"
sed -i '5s;.*;libdir=${prefix}/lib;' "$shaderc_pkgconfig_file"
echo "PKG_CONFIG_PATH=\"$(realpath "VulkanSDK/$(ls VulkanSDK)/$os_arch/lib/pkgconfig")\"" >> $GITHUB_ENV
if [ -f $shaderc_pkgconfig_file ]; then
prefix_path=$(realpath "VulkanSDK/$(ls VulkanSDK)/$os_arch")
sed -i '3s;.*;prefix=\"'$prefix_path'\";' "$shaderc_pkgconfig_file"
sed -i '5s;.*;libdir=${prefix}/lib;' "$shaderc_pkgconfig_file"
echo "PKG_CONFIG_PATH=\"$(realpath "VulkanSDK/$(ls VulkanSDK)/$os_arch/lib/pkgconfig")\"" >> $GITHUB_ENV
fi
fi
# Also install the dependencies for building GLEW here.
sudo apt install libxmu-dev libxi-dev libgl-dev libglu1-mesa-dev
Expand Down
10 changes: 6 additions & 4 deletions .github/workflows/test-volumetric-path-tracing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,12 @@ jobs:
tar -xf vulkan-sdk.tar.gz -C VulkanSDK
# Fix pkgconfig file.
shaderc_pkgconfig_file="VulkanSDK/$(ls VulkanSDK)/$os_arch/lib/pkgconfig/shaderc.pc"
prefix_path=$(realpath "VulkanSDK/$(ls VulkanSDK)/$os_arch")
sed -i '3s;.*;prefix=\"'$prefix_path'\";' "$shaderc_pkgconfig_file"
sed -i '5s;.*;libdir=${prefix}/lib;' "$shaderc_pkgconfig_file"
echo "PKG_CONFIG_PATH=\"$(realpath "VulkanSDK/$(ls VulkanSDK)/$os_arch/lib/pkgconfig")\"" >> $GITHUB_ENV
if [ -f $shaderc_pkgconfig_file ]; then
prefix_path=$(realpath "VulkanSDK/$(ls VulkanSDK)/$os_arch")
sed -i '3s;.*;prefix=\"'$prefix_path'\";' "$shaderc_pkgconfig_file"
sed -i '5s;.*;libdir=${prefix}/lib;' "$shaderc_pkgconfig_file"
echo "PKG_CONFIG_PATH=\"$(realpath "VulkanSDK/$(ls VulkanSDK)/$os_arch/lib/pkgconfig")\"" >> $GITHUB_ENV
fi
fi
- name: Configure CMake (sgl)
Expand Down
15 changes: 10 additions & 5 deletions build-linux-vcpkg.sh
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,10 @@ if [[ ! -v VULKAN_SDK ]]; then
if [ -d "VulkanSDK" ]; then
VK_LAYER_PATH=""
source "VulkanSDK/$(ls VulkanSDK)/setup-env.sh"
export PKG_CONFIG_PATH="$(realpath "VulkanSDK/$(ls VulkanSDK)/$os_arch/lib/pkgconfig")"
pkgconfig_dir="$(realpath "VulkanSDK/$(ls VulkanSDK)/$os_arch/lib/pkgconfig")"
if [ -d "$pkgconfig_dir" ]; then
export PKG_CONFIG_PATH="$pkgconfig_dir"
fi
found_vulkan=true
fi

Expand Down Expand Up @@ -229,10 +232,12 @@ if [[ ! -v VULKAN_SDK ]]; then

# Fix pkgconfig file.
shaderc_pkgconfig_file="VulkanSDK/$(ls VulkanSDK)/$os_arch/lib/pkgconfig/shaderc.pc"
prefix_path=$(realpath "VulkanSDK/$(ls VulkanSDK)/$os_arch")
sed -i '3s;.*;prefix=\"'$prefix_path'\";' "$shaderc_pkgconfig_file"
sed -i '5s;.*;libdir=${prefix}/lib;' "$shaderc_pkgconfig_file"
export PKG_CONFIG_PATH="$(realpath "VulkanSDK/$(ls VulkanSDK)/$os_arch/lib/pkgconfig")"
if [ -f "$shaderc_pkgconfig_file" ]; then
prefix_path=$(realpath "VulkanSDK/$(ls VulkanSDK)/$os_arch")
sed -i '3s;.*;prefix=\"'$prefix_path'\";' "$shaderc_pkgconfig_file"
sed -i '5s;.*;libdir=${prefix}/lib;' "$shaderc_pkgconfig_file"
export PKG_CONFIG_PATH="$(realpath "VulkanSDK/$(ls VulkanSDK)/$os_arch/lib/pkgconfig")"
fi
found_vulkan=true
fi

Expand Down
15 changes: 10 additions & 5 deletions build-linux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,10 @@ if [[ ! -v VULKAN_SDK ]]; then
if [ -d "VulkanSDK" ]; then
VK_LAYER_PATH=""
source "VulkanSDK/$(ls VulkanSDK)/setup-env.sh"
export PKG_CONFIG_PATH="$(realpath "VulkanSDK/$(ls VulkanSDK)/$os_arch/lib/pkgconfig")"
pkgconfig_dir="$(realpath "VulkanSDK/$(ls VulkanSDK)/$os_arch/lib/pkgconfig")"
if [ -d "$pkgconfig_dir" ]; then
export PKG_CONFIG_PATH="$pkgconfig_dir"
fi
found_vulkan=true
fi

Expand Down Expand Up @@ -271,10 +274,12 @@ if [[ ! -v VULKAN_SDK ]]; then

# Fix pkgconfig file.
shaderc_pkgconfig_file="VulkanSDK/$(ls VulkanSDK)/$os_arch/lib/pkgconfig/shaderc.pc"
prefix_path=$(realpath "VulkanSDK/$(ls VulkanSDK)/$os_arch")
sed -i '3s;.*;prefix=\"'$prefix_path'\";' "$shaderc_pkgconfig_file"
sed -i '5s;.*;libdir=${prefix}/lib;' "$shaderc_pkgconfig_file"
export PKG_CONFIG_PATH="$(realpath "VulkanSDK/$(ls VulkanSDK)/$os_arch/lib/pkgconfig")"
if [ -f "$shaderc_pkgconfig_file" ]; then
prefix_path=$(realpath "VulkanSDK/$(ls VulkanSDK)/$os_arch")
sed -i '3s;.*;prefix=\"'$prefix_path'\";' "$shaderc_pkgconfig_file"
sed -i '5s;.*;libdir=${prefix}/lib;' "$shaderc_pkgconfig_file"
export PKG_CONFIG_PATH="$(realpath "VulkanSDK/$(ls VulkanSDK)/$os_arch/lib/pkgconfig")"
fi
found_vulkan=true
fi

Expand Down

0 comments on commit 5dc6bbf

Please sign in to comment.