Fix build when .git is a gitlink file
authorChad Versace <chadversary@google.com>
Fri, 3 Nov 2017 16:36:30 +0000 (09:36 -0700)
committerAlexander Galazin <Alexander.Galazin@arm.com>
Fri, 12 Jul 2019 08:58:33 +0000 (04:58 -0400)
commit2e53d4f33bb9673a290c3fb3cad250f655cbc405
tree585012473292c7c6d8d213479c421e11d1d90c26
parent9bc38fb2380e9a00759d28d52ebc1f0ade0b1e4b
Fix build when .git is a gitlink file

If ${CMAKE_SOURCE_DIR}/.git exists, then
framework/qphelper/CMakeLists.txt uses the git revision as the dEQP
revision. The CMake rules update the revision when the files
${CMAKE_SOURCE_DIR}/.git/HEAD and ${CMAKE_SOURCE_DIR}/.git/index
change.

However, Git does not require that .git be a directory. If
git-submodules or git-worktrees are used, then .git may be a gitlink
file instead and the real git directory is elsewhere.

Fix the build by using `git rev-parse --git-dir` to find the real git dir
and `git rev-parse HEAD` to query the commit sha1.

This bumps the CMake requirement from 2.8 to 2.8.2. But that should be
safe since 2.8.2 was released in 2010.

Components: Framework
Change-Id: I811630e5afada8e6aed611b0ef6c51e39be2200b
(cherry picked from commit b5cd0ad3079ea00f0d4b243280430a36594eaae4)
CMakeLists.txt
framework/qphelper/CMakeLists.txt
framework/qphelper/gen_release_info.py