diff --git a/.travis.yml b/.travis.yml index e5189a33..df2c4203 100644 --- a/.travis.yml +++ b/.travis.yml @@ -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: diff --git a/Docs/Whats_New.md b/Docs/Whats_New.md index 9c4c3ddd..fbca82fe 100644 --- a/Docs/Whats_New.md +++ b/Docs/Whats_New.md @@ -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. diff --git a/README.md b/README.md index 046524c4..72d7fd14 100644 --- a/README.md +++ b/README.md @@ -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`: diff --git a/Templates/spirv-tools/build.zip b/Templates/spirv-tools/build.zip new file mode 100644 index 00000000..2434da03 Binary files /dev/null and b/Templates/spirv-tools/build.zip differ diff --git a/fetchDependencies b/fetchDependencies index 92e2ec6a..89ad70e3 100755 --- a/fetchDependencies +++ b/fetchDependencies @@ -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 -------------------