You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

build_vulkan_vision_linux.sh 2.4 kB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. #!/bin/bash
  2. # Copyright 2021 Huawei Technologies Co., Ltd.
  3. #
  4. # Licensed under the Apache License, Version 2.0 (the "License");
  5. # you may not use this file except in compliance with the License.
  6. # You may obtain a copy of the License at
  7. #
  8. # http://www.apache.org/licenses/LICENSE-2.0
  9. #
  10. # Unless required by applicable law or agreed to in writing, software
  11. # distributed under the License is distributed on an "AS IS" BASIS,
  12. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. # See the License for the specific language governing permissions and
  14. # limitations under the License.
  15. set -e
  16. start_dir=$(pwd)
  17. cd "$(dirname "$0")"/../../ecosystem_tools/VulkanVision
  18. if [[ ! -d "SPIRV-Tools" ]]
  19. then
  20. echo "Cloning SPIRV-Tools"
  21. git clone https://github.com/KhronosGroup/SPIRV-Tools --branch v2020.6
  22. cp st-patches/*.patch SPIRV-Tools
  23. cd SPIRV-Tools
  24. # These are the current stable changes and can be updated with new releases
  25. git apply 0001-spirv-opt-Add-auto-inst-passes.patch
  26. rm *.patch
  27. git clone https://github.com/KhronosGroup/SPIRV-Headers.git external/spirv-headers --branch 1.5.4.raytracing.fixed
  28. git clone https://github.com/google/effcee.git external/effcee --branch v2019.1
  29. git clone https://github.com/google/re2.git external/re2 --branch 2020-11-01
  30. cd ..
  31. fi
  32. if [[ ! -d "Vulkan-ValidationLayers" ]]
  33. then
  34. echo "Cloning Vulkan-ValidationLayers"
  35. git clone https://github.com/KhronosGroup/Vulkan-ValidationLayers --branch sdk-1.2.162
  36. cp vv-patches/*.patch Vulkan-ValidationLayers
  37. cd Vulkan-ValidationLayers
  38. # These are the current stable changes and can be updated with new releases
  39. git apply 0001-layers-Added-auto-inst-layers.patch
  40. rm *.patch
  41. cd ..
  42. fi
  43. build_dir=$(pwd)
  44. echo "Building SPIRV-Tools"
  45. cd SPIRV-Tools
  46. mkdir build
  47. cd build
  48. mkdir install
  49. cmake -DCMAKE_BUILD_TYPE=release -DCMAKE_INSTALL_PREFIX=install ..
  50. cmake --build . --target install --config Release -- -j 4
  51. cd $build_dir
  52. echo "Building Vulkan-ValidationLayers"
  53. cd Vulkan-ValidationLayers
  54. mkdir build
  55. cd build
  56. mkdir install
  57. python ../scripts/update_deps.py --config release
  58. cmake -DCMAKE_BUILD_TYPE=release -DCMAKE_INSTALL_PREFIX=install -DSPIRV_TOOLS_INSTALL_DIR=$build_dir/SPIRV-Tools/build/install -C helper.cmake ..
  59. cmake --build . --target install --config Release -- -j 4
  60. echo "Build completed at $build_dir"!
  61. cd $start_dir