Update fetchDependencies script to use pre-built spirv-tools files by default.

This commit is contained in:
Bill Hollings 2020-06-02 13:30:52 -04:00
parent fe1e5c52d0
commit 4a5bf6953c
4 changed files with 31 additions and 18 deletions

View File

@ -4,11 +4,9 @@ language: objective-c
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"

View File

@ -202,9 +202,10 @@ the *SPIRV-Tools* library to the `ExternalDependencies` *Xcode* project as follo
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.

View File

@ -14,6 +14,11 @@ SPV_TLS_BLD_DIR="${EXT_DIR}/glslang/External/spirv-tools/build"
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}"

View File

@ -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 @@ XC_BUILD_VERBOSITY="-quiet"
V_HEADERS_ROOT=""
SPIRV_CROSS_ROOT=""
GLSLANG_ROOT=""
SKIP_SPV_TLS_BLD=""
BLD_SPV_TLS=""
while (( "$#" )); do
case "$1" in
@ -53,8 +58,12 @@ while (( "$#" )); do
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 @@ fi
# 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