Skip to content

Commit 648f6fb

Browse files
authored
Merge pull request #274 from thomasmoelhave/no_git_commit_in_build
Allow disabeling putting git commit into code
2 parents da83fb4 + 96eb7b4 commit 648f6fb

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

Diff for: CMakeLists.txt

+11-4
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,17 @@ endif(TPIE_FRACTIONDB_DIR_INL)
2727
check_include_files("unistd.h" TPIE_HAVE_UNISTD_H)
2828
check_include_files("sys/unistd.h" TPIE_HAVE_SYS_UNISTD_H)
2929

30-
# Ryan Pavlik's Git revision description helper
31-
# http://stackoverflow.com/a/4318642
32-
include(GetGitRevisionDescription)
33-
get_git_head_revision(GIT_REFSPEC GIT_COMMIT)
30+
31+
option(TPIE_USE_GIT_COMMIT "Use git commit" ON)
32+
if(TPIE_USE_GIT_COMMIT)
33+
# Ryan Pavlik's Git revision description helper
34+
# http://stackoverflow.com/a/4318642
35+
include(GetGitRevisionDescription)
36+
get_git_head_revision(GIT_REFSPEC GIT_COMMIT)
37+
else(TPIE_USE_GIT_COMMIT)
38+
set(GIT_REFSPEC "no_git_ref")
39+
set(GIT_COMMIT "no_git_commit")
40+
endif()
3441

3542
## Snappy
3643
option(TPIE_USE_SNAPPY "Use Snappy, a fast compressor/decompressor" ON)

0 commit comments

Comments
 (0)