From c74c199cfbab5d54dad0046b0d747ace552aebe4 Mon Sep 17 00:00:00 2001 From: Junghyun Kim Date: Thu, 25 Aug 2016 09:14:08 +0900 Subject: [PATCH] build: Use commit date instead of build date to avoid unnecessary rebuilds. - Problem We use OBS to build packages in Tizen. There is a mechanism not to rebuild when the result binary is the same. For example, there is a dependency graph: A->B->C. If A is modified, B would be built. If the result RPM of B is not changed, OBS does not trigger a build of C. To effectively use this mechanism, each packages make sure that the result binary should be the same if the input source is the same. There is a reason we found is including build date. In coregl, bash command 'date' is used in CMakeList.txt. In this case, everytime we build coregl, the build result is always different. - Solution Use commit date instead of build date. There was a hint in Makefile. COMPILE_DATE = "\"`git log -1 --pretty=format:%ci`\"" I used this command in CMakeList.txt I tested this in my test OBS server, and the build result is unchanged when this patch is applied. Change-Id: Iea70e74b6808aa81905eba4afc9e72b6867c097d Signed-off-by: Junghyun Kim --- CMakeLists.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 39bd6ad..78417b6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -43,7 +43,9 @@ INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include_KHR) ADD_DEFINITIONS("-DPREFIX=\"${PREFIX}\"") -EXEC_PROGRAM(date OUTPUT_VARIABLE COMPILE_DATE) +EXEC_PROGRAM(git + ARGS log -1 --pretty=format:%ci + OUTPUT_VARIABLE COMPILE_DATE) ADD_DEFINITIONS("-D_COREGL_COMPILE_DATE=\"${COMPILE_DATE}\"") IF(USE_ADRENO) -- 2.7.4