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 osx_image: xcode10
# Build dependencies # Build dependencies
# Travis has trouble with python3, which SPIRV-Tools requires,
# so skip the SPIRV-Tools build, and use templeted headers instead.
install: install:
- brew install python3 - ./fetchDependencies --skip-spirv-tools-build
- pip3 install virtualenv
- virtualenv -p python3 .
- ./fetchDependencies -v
# Cache built deps # Cache built deps
cache: cache:

View File

@ -20,6 +20,7 @@ Released TBD
- On iOS GPU family 2 and earlier, support immutable depth-compare samplers - On iOS GPU family 2 and earlier, support immutable depth-compare samplers
as constexpr samplers hardcoded in MSL. 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: 1. Ensure you have `cmake` and `python3` installed:
brew install cmake brew install cmake
brew install python brew install python3
For faster dependency builds, you can also optionally install `ninja`: 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 # 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 # --debug
# "path" specifies a directory path to a # Build the external libraries in Debug mode, which may be useful when debugging
# KhronosGroup/Vulkan-Headers repository. # and tracing calls into those libraries.
# 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.
# #
# --glslang-root path # --glslang-root path
# "path" specifies a directory path to a KhronosGroup/glslang # "path" specifies a directory path to a KhronosGroup/glslang repository.
# repository. This repository does need to be built and the # This repository does need to be built and the build directory must be in the
# build directory must be in the specified directory. # specified directory. It should be built the same way this script builds it.
# 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 # -v verbose output
# #
# --debug # --v-headers-root path
# Build the external libraries in Debug mode, which may be useful # "path" specifies a directory path to a KhronosGroup/Vulkan-Headers repository.
# when debugging and tracing calls into those libraries. # This repository does not have to be built.
# #
set -o errexit set -o errexit
@ -38,6 +41,7 @@ XC_BUILD_VERBOSITY="-quiet"
V_HEADERS_ROOT="" V_HEADERS_ROOT=""
SPIRV_CROSS_ROOT="" SPIRV_CROSS_ROOT=""
GLSLANG_ROOT="" GLSLANG_ROOT=""
SKIP_SPV_TLS_BLD=""
while (( "$#" )); do while (( "$#" )); do
case "$1" in case "$1" in
@ -49,6 +53,10 @@ while (( "$#" )); do
XC_BUILD_VERBOSITY="" XC_BUILD_VERBOSITY=""
shift 1 shift 1
;; ;;
--skip-spirv-tools-build)
SKIP_SPV_TLS_BLD="Y"
shift 1
;;
--v-headers-root) --v-headers-root)
V_HEADERS_ROOT=$2 V_HEADERS_ROOT=$2
shift 2 shift 2
@ -220,8 +228,15 @@ else
cd - > /dev/null cd - > /dev/null
fi fi
#Make sure the embedded spirv-tools is built # Build the embedded spirv-tools, or use option of pre-generated headers
build_repo "${REPO_NAME}/External/spirv-tools" 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 ------------------- # ----------------- Vulkan-Tools -------------------