Commit graph

6 commits

Author SHA1 Message Date
Joseph Rushton Wakeling
f457ab78a2 Add option to avoid recursing in get_git_head_revision cmake function
Since this function is only ever invoked from the base directory of the
LDC source tree, it does not need to recurse in order to get the correct
git revision for LDC.  This patch therefore adds a parameter that can be
set to `TRUE` or `FALSE` depending on whether one wants to use recursion
or not, and sets it to false in when calling `get_git_head_revision` in
LDC's own `CMakeLists.txt`.

This should prevent issues that arise when building from source tarballs
that have been extracted into a subdirectory of another git tree (!).
This is unfortunately a real possibility: apart from folks using git to
version their home directory [1], it has also proven an issue when using
source tarballs to build the LDC snap package [2].

[1]42946460
[2]https://github.com/ldc-developers/ldc2.snap/issues/21#issuecomment-287575769

Fixes https://github.com/ldc-developers/ldc/issues/2042.
2017-03-30 01:37:41 +02:00
Johan Engelen
23c1749937 For non-tagged commits, change version string to e.g. "1.1.0git-c693e26" (#1887)
Also appends "-dirty" to version string when the working copy is dirty.
2016-11-17 22:33:36 +01:00
Dan Olson
b2d51d655b Fix cmake bug when ldc is a submodule
Allow ldc to be a submodule.  This uses changes from
https://github.com/rpavlik/cmake-modules.

(cherry picked from commit 0be5ead42e6049f8e51453a82a17b1770646a1a2)
2015-03-21 18:25:20 +01:00
David Nadlinger
66484b580a Simplify git_describe to work on CMake 2.8.0.
FindGit doesn't seem to work as expected on Ubuntu 10.04
(GIT-NOTFOUND even though Git is installed and available
on the $PATH).

This implementation might be overly simplistic and it
should probably use find_program() to locate Git. We need
to revisit this after the 0.12.0 release is out.
2013-10-21 23:35:28 +02:00
David Nadlinger
f9e141a006 Prefer named tags to Git revision hashes for LDC verison.
This allows for building of release packages without
manually overriding the version string.

The --tag argument is needed to pick up un-annotated tags
as well.
2013-10-09 16:05:29 +02:00
kai
aa143b560c Include Git revision in version info.
CMakeLists.txt contains now the version numbers for DMD and (next) LDC release.
If a .git folder is found then the LDC version is replaced by the first 6 chars
of the Git revision.

Possible improvements:

- If the build is not done at the master branch then it could be useful to check for a tag and use the tag instead of the revision. (for release builds)
- Maybe it is useful to include the branch name.

This fixes issue #366.
2013-06-21 06:47:32 +02:00