scripts: Fix error if spirv-tools dir had no .git (#2346)
authorCort Stratton <cort@google.com>
Fri, 2 Feb 2018 07:25:21 +0000 (23:25 -0800)
committerCody Northrop <cnorthrop@google.com>
Mon, 5 Feb 2018 23:05:28 +0000 (16:05 -0700)
commit88c31ae4ba67db109a243fff545a8117514a4b5a
treed3193865d800d851439f52c7a7ddc1fccbdd19fc
parent9960ee8a3875a185d69dbdc8dc347862d3cfdf4d
scripts: Fix error if spirv-tools dir had no .git (#2346)

external_revision_generator.py generates a UUID for
VkValidationCacheEXT objects created by the layers, based on
the commit ID of the HEAD revision in the spirv-tools repo
used to build those layers. This implicitly required that
the spirv-tools source is hosted in a Git repository, which
is not the case in all validation layers build environments.

The script has been modified to accept *either* a path to
a Git working directory to query *or* a path to a file whose
contents are SHA1-hashed (if necessary) and treated as the
"commit ID" for the project.

Call sites for the script in the CMake and Android build paths
have been updated to use the --git_dir approach by default,
which matches the pre-existing behavior.
CMakeLists.txt
build-android/android-generate.bat
build-android/android-generate.sh
scripts/external_revision_generator.py