Skip SPIRV-Tools build in Travis.

Add fetchDependencies option to skip building SPIRV-Tools and use a template of pre-generated headers.
Modify .travis.yml to use this.
This commit is contained in:
Bill Hollings 2019-06-16 12:00:22 -04:00
parent cd1023e23f
commit ef8de08ff1
5 changed files with 39 additions and 24 deletions

View File

@ -4,11 +4,10 @@ language: objective-c
osx_image: xcode10
# Build dependencies
# Travis has trouble with python3, which SPIRV-Tools requires,
# so skip the SPIRV-Tools build, and use templeted headers instead.
install:
- brew install python3
- pip3 install virtualenv
- virtualenv -p python3 .
- ./fetchDependencies -v
- ./fetchDependencies --skip-spirv-tools-build
# Cache built deps
cache:

View File

@ -20,6 +20,7 @@ Released TBD
- On iOS GPU family 2 and earlier, support immutable depth-compare samplers
as constexpr samplers hardcoded in MSL.
- Skip SPIRV-Tools build in Travis.

View File

@ -99,7 +99,7 @@ on which **MoltenVK** relies:
1. Ensure you have `cmake` and `python3` installed:
brew install cmake
brew install python
brew install python3
For faster dependency builds, you can also optionally install `ninja`:

Binary file not shown.

View File

@ -4,29 +4,32 @@
#
# fetchDependencies - Retrieves the correct versions of all dependencies
#
# macOS usage: ./fetchDependencies [-v] [--debug] [--v-headers-root path] [--spirv-cross-root path] [--glslang-root path]
# macOS usage: ./fetchDependencies [-v] [--debug] [--skip-spirv-tools-build]
# [--v-headers-root path] [--spirv-cross-root path] [--glslang-root path]
#
# --v-headers-root path
# "path" specifies a directory path to a
# KhronosGroup/Vulkan-Headers repository.
# This repository does not have to be built.
#
# --spirv-cross-root path
# "path" specifies a directory path to a
# KhronosGroup/SPIRV-Cross repository.
# This repository does not have to be built.
# --debug
# Build the external libraries in Debug mode, which may be useful when debugging
# and tracing calls into those libraries.
#
# --glslang-root path
# "path" specifies a directory path to a KhronosGroup/glslang
# repository. This repository does need to be built and the
# build directory must be in the specified directory.
# It should be built the same way this script builds it.
# "path" specifies a directory path to a KhronosGroup/glslang repository.
# This repository does need to be built and the build directory must be in the
# specified directory. It should be built the same way this script builds it.
#
# --skip-spirv-tools-build
# Skip the spirv-tools build and install a template of pre-generated SPIRV-Tools header files
# instead. The primary purpose of this is to allow Travis CI to skip the SPIRV-Tools build
# because Travis cannot support the required use of Python3 by the SPIRV-Tools build.
#
# --spirv-cross-root path
# "path" specifies a directory path to a KhronosGroup/SPIRV-Cross repository.
# This repository does not have to be built.
#
# -v verbose output
#
# --debug
# Build the external libraries in Debug mode, which may be useful
# when debugging and tracing calls into those libraries.
# --v-headers-root path
# "path" specifies a directory path to a KhronosGroup/Vulkan-Headers repository.
# This repository does not have to be built.
#
set -o errexit
@ -38,6 +41,7 @@ XC_BUILD_VERBOSITY="-quiet"
V_HEADERS_ROOT=""
SPIRV_CROSS_ROOT=""
GLSLANG_ROOT=""
SKIP_SPV_TLS_BLD=""
while (( "$#" )); do
case "$1" in
@ -49,6 +53,10 @@ while (( "$#" )); do
XC_BUILD_VERBOSITY=""
shift 1
;;
--skip-spirv-tools-build)
SKIP_SPV_TLS_BLD="Y"
shift 1
;;
--v-headers-root)
V_HEADERS_ROOT=$2
shift 2
@ -220,8 +228,15 @@ else
cd - > /dev/null
fi
#Make sure the embedded spirv-tools is built
build_repo "${REPO_NAME}/External/spirv-tools"
# Build the embedded spirv-tools, or use option of pre-generated headers
SPV_TLS_DIR="${REPO_NAME}/External/spirv-tools"
if [ ! "$SKIP_SPV_TLS_BLD" = "" ]; then
unzip -o -q -d "${SPV_TLS_DIR}" ../Templates/spirv-tools/build.zip
rm -rf "${SPV_TLS_DIR}/__MACOSX"
else
build_repo "${SPV_TLS_DIR}"
fi
# ----------------- Vulkan-Tools -------------------