[Beignet] [PATCH] create GIT_SHA1 without any dependency
Meng Mengmeng
mengmeng.meng at intel.com
Fri Oct 24 12:10:02 PDT 2014
---
src/CMakeLists.txt | 5 ++---
src/git_sha1.sh | 4 ++--
2 files changed, 4 insertions(+), 5 deletions(-)
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 0d22589..9e65856 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -110,11 +110,10 @@ SET(CMAKE_C_FLAGS "-DHAS_OCLIcd ${CMAKE_C_FLAGS}")
endif (OCLIcd_FOUND)
set(GIT_SHA1 "git_sha1.h")
-add_custom_command(OUTPUT ${GIT_SHA1}
+add_custom_target(${GIT_SHA1} ALL
COMMAND chmod +x ${CMAKE_CURRENT_SOURCE_DIR}/git_sha1.sh
COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/git_sha1.sh ${CMAKE_CURRENT_SOURCE_DIR} ${GIT_SHA1}
- )
-add_custom_target(GIT_SHA1 ALL DEPENDS ${GIT_SHA1})
+)
SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,-Bsymbolic,--allow-shlib-undefined")
diff --git a/src/git_sha1.sh b/src/git_sha1.sh
index 4f6f972..f44f078 100755
--- a/src/git_sha1.sh
+++ b/src/git_sha1.sh
@@ -4,9 +4,9 @@ SOURCE_DIR=$1
FILE=$2
touch ${SOURCE_DIR}/${FILE}_tmp
-if test -d $1/../.git; then
+if test -d ${SOURCE_DIR}/../.git; then
if which git > /dev/null; then
- git --git-dir=$1/../.git log -n 1 --oneline | \
+ git --git-dir=${SOURCE_DIR}/../.git log -n 1 --oneline | \
sed 's/^\([^ ]*\) .*/#define BEIGNET_GIT_SHA1 "git-\1"/' \
> ${SOURCE_DIR}/${FILE}_tmp
fi
--
1.9.3
More information about the Beignet
mailing list