Skip to content

Commit

Permalink
Merge pull request #222 from nberth/out-of-source-version
Browse files Browse the repository at this point in the history
Generate `version.mlt`s that support out-of-source builds
  • Loading branch information
lefessan committed Jun 5, 2024
2 parents 6ce330a + 31bcc91 commit b42a6f0
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/drom_lib/genVersion.ml
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,13 @@ let query cmd =
else None
with End_of_file -> None

let commit_hash = query "git show -s --pretty=format:%%H"
let commit_date = query "git show -s --pretty=format:%%ci"
let gitdir =
try Sys.getenv "DUNE_SOURCEROOT" with Not_found -> ""

let commit_hash =
query ("git -C \""^gitdir^"\" show -s --pretty=format:%%H")
let commit_date =
query ("git -C \""^gitdir^"\" show -s --pretty=format:%%ci")
let version = %S

let string_option = function
Expand Down

0 comments on commit b42a6f0

Please sign in to comment.