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 os: osx
osx_image: xcode11.5 osx_image: xcode11.5
# Build dependencies # Build dependencies with verbose logging to avoid Travis timing out.
# Travis has trouble with python3, which SPIRV-Tools requires,
# so skip the SPIRV-Tools build, and use templeted headers instead.
install: install:
- ./fetchDependencies -v --skip-spirv-tools-build - ./fetchDependencies -v
script: script:
- xcodebuild -project MoltenVKPackaging.xcodeproj -scheme "MoltenVK Package" - 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`. 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` 6. In the `Scripts` folder, run `./packagePregenSpirvToolsHeaders`, which will fetch and build the
from the `*.h` and `*.inc` files in `External/glslang/External/spirv-tools/build`, and test by running full `SPIRV-Tools` library and will update `Templates/spirv-tools/build.zip` from the `*.h` and
`./fetchDependencies --skip-spirv-tools-build`, and a **MoltenVK** build. `*.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_DIR=../Templates/spirv-tools
TPLT_BLD_DIR="${TPLT_DIR}/build" 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}" rm -rf "${TPLT_BLD_DIR}"
mkdir -p "${TPLT_BLD_DIR}" mkdir -p "${TPLT_BLD_DIR}"
cp -a "${SPV_TLS_BLD_DIR}/"*.h "${SPV_TLS_BLD_DIR}/"*.inc "${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 # 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] # [--v-headers-root path] [--spirv-cross-root path] [--glslang-root path]
# #
# --debug # --debug
@ -16,10 +16,15 @@
# This repository does need to be built and the build directory must be in the # 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. # specified directory. It should be built the same way this script builds it.
# #
# --skip-spirv-tools-build # --build-spirv-tools
# Skip the spirv-tools build and install a template of pre-generated SPIRV-Tools header files # Build the full spirv-tools distribution. Normally this is not needed, because
# instead. The primary purpose of this is to allow Travis CI to skip the SPIRV-Tools build # MoltenVK includes a template of pre-generated SPIRV-Tools header files, which
# because Travis cannot support the required use of Python3 by the SPIRV-Tools build. # 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 # --spirv-cross-root path
# "path" specifies a directory path to a KhronosGroup/SPIRV-Cross repository. # "path" specifies a directory path to a KhronosGroup/SPIRV-Cross repository.
@ -41,7 +46,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="" BLD_SPV_TLS=""
while (( "$#" )); do while (( "$#" )); do
case "$1" in case "$1" in
@ -53,8 +58,12 @@ while (( "$#" )); do
XC_BUILD_VERBOSITY="" XC_BUILD_VERBOSITY=""
shift 1 shift 1
;; ;;
--skip-spirv-tools-build) --build-spirv-tools)
SKIP_SPV_TLS_BLD="Y" BLD_SPV_TLS="Y"
shift 1
;;
--skip-spirv-tools-build) #deprecated
BLD_SPV_TLS=""
shift 1 shift 1
;; ;;
--v-headers-root) --v-headers-root)
@ -226,11 +235,11 @@ fi
# Build the embedded spirv-tools, or use option of pre-generated headers # Build the embedded spirv-tools, or use option of pre-generated headers
SPV_TLS_DIR="${REPO_NAME}/External/spirv-tools" 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 unzip -o -q -d "${SPV_TLS_DIR}" ../Templates/spirv-tools/build.zip
rm -rf "${SPV_TLS_DIR}/__MACOSX" rm -rf "${SPV_TLS_DIR}/__MACOSX"
else
build_repo "${SPV_TLS_DIR}"
fi fi