Merge pull request #903 from billhollings/master
Update fetchDependencies script to use pre-built spirv-tools files by default.
diff --git a/.travis.yml b/.travis.yml
index cd6bc54..3856b71 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -4,11 +4,9 @@
os: osx
osx_image: xcode11.5
-# Build dependencies
-# Travis has trouble with python3, which SPIRV-Tools requires,
-# so skip the SPIRV-Tools build, and use templeted headers instead.
+# Build dependencies with verbose logging to avoid Travis timing out.
install:
- - ./fetchDependencies -v --skip-spirv-tools-build
+ - ./fetchDependencies -v
script:
- xcodebuild -project MoltenVKPackaging.xcodeproj -scheme "MoltenVK Package"
diff --git a/ExternalRevisions/README.md b/ExternalRevisions/README.md
index 6eb1886..b14fd7b 100644
--- a/ExternalRevisions/README.md
+++ b/ExternalRevisions/README.md
@@ -202,9 +202,10 @@
5. Remove the *Group* named `fuzz` from under the *Group* named `External/SPIRV-Tools/source`.
-6. In the `Scripts` folder, run `./packagePregenSpirvToolsHeaders` to update `Templates/spirv-tools/build.zip`
- from the `*.h` and `*.inc` files in `External/glslang/External/spirv-tools/build`, and test by running
- `./fetchDependencies --skip-spirv-tools-build`, and a **MoltenVK** build.
+6. In the `Scripts` folder, run `./packagePregenSpirvToolsHeaders`, which will fetch and build the
+ full `SPIRV-Tools` library and will update `Templates/spirv-tools/build.zip` from the `*.h` and
+ `*.inc` files in `External/glslang/External/spirv-tools/build`. Test by running `./fetchDependencies`
+ and a **MoltenVK** build.
diff --git a/Scripts/packagePregenSpirvToolsHeaders b/Scripts/packagePregenSpirvToolsHeaders
index d77620d..0ccaf8a 100755
--- a/Scripts/packagePregenSpirvToolsHeaders
+++ b/Scripts/packagePregenSpirvToolsHeaders
@@ -14,6 +14,11 @@
TPLT_DIR=../Templates/spirv-tools
TPLT_BLD_DIR="${TPLT_DIR}/build"
+# Ensure the SPIRV-Tools library is fully built
+cd ".."
+./fetchDependencies --build-spirv-tools
+cd - > /dev/null
+
rm -rf "${TPLT_BLD_DIR}"
mkdir -p "${TPLT_BLD_DIR}"
cp -a "${SPV_TLS_BLD_DIR}/"*.h "${SPV_TLS_BLD_DIR}/"*.inc "${TPLT_BLD_DIR}"
diff --git a/fetchDependencies b/fetchDependencies
index 2827b26..cd4f3a8 100755
--- a/fetchDependencies
+++ b/fetchDependencies
@@ -4,7 +4,7 @@
#
# fetchDependencies - Retrieves the correct versions of all dependencies
#
-# macOS usage: ./fetchDependencies [-v] [--debug] [--skip-spirv-tools-build]
+# macOS usage: ./fetchDependencies [-v] [--debug] [--build-spirv-tools]
# [--v-headers-root path] [--spirv-cross-root path] [--glslang-root path]
#
# --debug
@@ -16,10 +16,15 @@
# 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.
+# --build-spirv-tools
+# Build the full spirv-tools distribution. Normally this is not needed, because
+# MoltenVK includes a template of pre-generated SPIRV-Tools header files, which
+# is all that is needed. Avoiding the spirv-tools build saves significant time
+# during the running of this script, and is necessary during CI because Travis CI
+# cannot support the required use of Python3 by the spirv-tools build. This flag
+# is used by the packagePregenSpirvToolsHeaders script which regenerates the
+# spirv-tools header files and repackages the Templates/spirv-tools/build.zip
+# file when the spirv-tools library version is upgraded.
#
# --spirv-cross-root path
# "path" specifies a directory path to a KhronosGroup/SPIRV-Cross repository.
@@ -41,7 +46,7 @@
V_HEADERS_ROOT=""
SPIRV_CROSS_ROOT=""
GLSLANG_ROOT=""
-SKIP_SPV_TLS_BLD=""
+BLD_SPV_TLS=""
while (( "$#" )); do
case "$1" in
@@ -53,8 +58,12 @@
XC_BUILD_VERBOSITY=""
shift 1
;;
- --skip-spirv-tools-build)
- SKIP_SPV_TLS_BLD="Y"
+ --build-spirv-tools)
+ BLD_SPV_TLS="Y"
+ shift 1
+ ;;
+ --skip-spirv-tools-build) #deprecated
+ BLD_SPV_TLS=""
shift 1
;;
--v-headers-root)
@@ -226,11 +235,11 @@
# 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
+if [ "$BLD_SPV_TLS" = "Y" ]; then
+ build_repo "${SPV_TLS_DIR}"
+else
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