summaryrefslogtreecommitdiffstats
path: root/llvm/cmake/modules/VersionFromVCS.cmake
Commit message (Collapse)AuthorAgeFilesLines
* [cmake] Remove SVN support from VersionFromVCS.cmakeTom Stellard2019-11-081-74/+29
| | | | | | | | | | Reviewers: phosek Subscribers: mgorny, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D69682
* [CMake] Unify scripts for generating VCS headersPetr Hosek2019-02-061-77/+79
| | | | | | | | | | | | | | | | | Previously, there were two different scripts for generating VCS headers: one used by LLVM and one used by Clang and lldb. They were both similar, but different. They were both broken in their own ways, for example the one used by Clang didn't properly handle monorepo resulting in an incorrect version information reported by Clang. This change unifies two the scripts by introducing a new script that's used from both LLVM, Clang and lldb, ensures that the new script supports both monorepo and standalone SVN and Git setups, and removes the old scripts. Differential Revision: https://reviews.llvm.org/D57063 llvm-svn: 353268
* Revert "[CMake] Unify scripts for generating VCS headers"Petr Hosek2019-01-311-75/+77
| | | | | | This reverts commits r352729 and r352731: this broke Sanitizer Windows bots llvm-svn: 352733
* [CMake] Unify scripts for generating VCS headersPetr Hosek2019-01-311-77/+75
| | | | | | | | | | | | | | | | Previously, there were two different scripts for generating VCS headers: one used by LLVM and one used by Clang. They were both similar, but different. They were both broken in their own ways, for example the one used by Clang didn't properly handle monorepo resulting in an incorrect version information reported by Clang. This change unifies two the scripts by introducing a new script that's used from both LLVM and Clang, ensures that the new script supports both monorepo and standalone SVN and Git setups, and removes the old scripts. Differential Revision: https://reviews.llvm.org/D57063 llvm-svn: 352729
* CMake: Silence more stderr when running git.Tim Northover2017-05-021-1/+2
| | | | | | It can confuse bots collecting errors. llvm-svn: 301934
* CMake: ignore git stderr when trying to sort out revision. NFC.Tim Northover2017-04-281-1/+2
| | | | llvm-svn: 301650
* Support: Add a VCSRevision.h header file.Peter Collingbourne2017-04-131-38/+46
| | | | | | | | | | | | | | | | | | | | | This is a magic header file supported by the build system that provides a single definition, LLVM_REVISION, containing an LLVM revision identifier, if available. This functionality previously lived in the LTO library, but I am moving it out to lib/Support because I want to also start using it in lib/Object to create the IR symbol table. This change also fixes a bug where LLVM_REVISION was never actually being used in lib/LTO because the macro HAS_LLVM_REVISION was never defined (it was misspelled as HAVE_SVN_VERSION_INC in lib/LTO/CMakeLists.txt, and was only being defined in a non-existent file Version.cpp). I also changed the code to use "git rev-parse --git-dir" to locate the .git directory, instead of looking for it in the LLVM source root directory, which makes this compatible with monorepos as well as git worktrees. Differential Revision: https://reviews.llvm.org/D31985 llvm-svn: 300160
* CMake: Clean up VersionFromVCS.cmakeTom Stellard2017-03-021-33/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Fix a few problems in VersionFromVCS.cmake to make it more reliable: - Stop using git svn info to retrieve the svn revision. I am unable to determine what the svn revision returned by this command means. During my testing this command returned a revision from a month ago which was not the HEAD of any of my local branches. Also, this revision was never actually added to the version string due to a typo in the script. All it was used for was to reject the revision number returned by git svn find-rev HEAD when the revision numbers didn't match. - Populate GIT_COMMIT even when we detect a git repo without any svn information. Reviewers: mehdi_amini, beanz Reviewed By: beanz Subscribers: mgorny, llvm-commits Differential Revision: https://reviews.llvm.org/D30092 llvm-svn: 296829
* Add SVN version to libLLVMLTOMehdi Amini2016-04-161-9/+15
| | | | | | | | | | | | | | | | | | | | Summary: For Incremental LTO, we need to make sure that an old cache entry is not used when incrementally re-linking with a new libLTO. Adding a global LLVM_REVISION in llvm-config.h would for to rebuild/relink the world for every "git pull"/"svn update". So instead only libLTO is made dependent on the VCS and will be rebuilt (and the dependent binaries relinked, i.e. as of today: libLTO.dylib and llvm-lto). Reviewers: beanz Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D18987 From: Mehdi Amini <mehdi.amini@apple.com> llvm-svn: 266523
* [cmake] Fix add_version_info_from_vcs git svn version bug.Geoff Berry2016-01-191-17/+9
| | | | | | | | | | | | | | | | | | | | Summary: add_version_info_from_vcs was setting SVN_REVISION to the last fetched svn revision when using git svn instead of the svn revision corresponding to HEAD. This leads to conflicts with the definition of SVN_REVISION in SVNVersion.inc generated by GetSVN.cmake when HEAD is not the most recently fetched svn revision. Use 'git svn info' to determine SVN_REVISION when git svn is being used instead (as is done in GetSVN.cmake). Reviewers: beanz Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D16299 llvm-svn: 258148
* [CMake] Add support for populating LLVM_REPOSITORY from CMake.Chris Bieneman2016-01-141-0/+16
| | | | | | Autoconf does this in the GetRepositoryPath script, CMake's VersionFromVCS does grab the SVN_REVISION, but doesn't populate the repository URL. llvm-svn: 257826
* CMake: Don't run 'git svn' if there is no .git/svn directory.Jim Grosbach2012-12-101-40/+42
| | | | | | | If the local checkout does not have 'git svn' references set up, don't try to use 'git svn' for version information. llvm-svn: 169749
* cmake: work with CMake < 2.8.5Dylan Noblesmith2011-12-121-1/+3
| | | | | | | | | | | CMake versions 2.8.4 and earlier were giving this error since r146323: "string end index: -1 is out of range 0 - 6" Passing -1 as the length of the desired substring was a new feature added in CMake 2.8.5: http://www.cmake.org/Bug/view.php?id=10740 llvm-svn: 146372
* Use a simpler and more reliable command for converting from HEAD toChandler Carruth2011-12-101-1/+1
| | | | | | commit-ish. Funny thing, they have a command designed for this. ;] llvm-svn: 146325
* Teach the VCS detection to set some root-level variables with the rawChandler Carruth2011-12-101-0/+3
| | | | | | | revision and git commit data extracted. This will be used in the Clang CMake build to avoid trying to re-detect the information. llvm-svn: 146324
* At the request of Michael Spencer, make the VCS version detection logicChandler Carruth2011-12-101-8/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | in CMake a bit more handy. Previously we would get such charming versions as the following for revision NNNN and commit-ish XXXXX: 3.1svnsvn-rNNNN 3.1svngit-svn-rNNNN 3.1svngit-svn-XXXXX The mechanism selecting betwene the latter two was particularly odd, and didn't work with all of the ways git-svn repos are set up apparently. It also misses an important point -- both the revision *and* the git commit might be relevant when working on a local branch some distance from mainline. The new logic does several things: 1) It strips the redundant initial 'svn'. 2) It always looks for a git-svn revision number base, and when found includes it in the version. 3) If the git commit-ish for the current HEAD is not exactly that revision number, it is also included. The resulting strings should roughly be: 3.1svn-rNNNN 3.1git-svn-rNNNN 3.1git-svn-rNNNN-XXXXX Suggestions on formatting etc always welcome. =] I've only looked at the LLVM version string here, not Clang's (yet). Note that the commit-ish reported is *not* terribly accurate. It updates when 'cmake' is run, not when the binary is built. Still, it may be better than nothing, especially if people have fairly long-lived git repos and branches. This is not a new limitation, just didn't want anyone to be surprised. llvm-svn: 146323
* Don't try to guess svn version when current path is a symlink.Oscar Fuentes2010-10-221-2/+5
| | | | | | See PR 8473. llvm-svn: 117109
* CMake: Use the svn revision information from git-svn if available.Michael J. Spencer2010-09-081-7/+17
| | | | llvm-svn: 113405
* When building from git, add ref-id to PACKAGE_VERSIONOscar Fuentes2010-08-051-0/+13
| | | | llvm-svn: 110301
* CMake: add version control info to PACKAGE_VERSION, if available.Oscar Fuentes2010-08-031-0/+20
Adds "svn" or "git", depending on the VCS used. If svn, adds the revision number as well. llvm-svn: 110121
OpenPOWER on IntegriCloud