Skip to content
This repository has been archived by the owner on Mar 30, 2021. It is now read-only.

Commit

Permalink
Clang and llvm Revision/repoitory now can be specified as compilation…
Browse files Browse the repository at this point in the history
… flag.

Alongside the existing -DSVN_REVISION flag, (which specifies the clang revision
number) now there are three more flag that can be specified when there are
no revision info in the clang/llvm source directory.

-DSVN_REPOSITORY=<url> specifies clang repository.
-DLLVM_REVISION=<revno> specifies llvm revision.
-DLLVM_REPOSITORY=<url> specigies llvm repositiory.
  • Loading branch information
vodorok committed Aug 22, 2018
1 parent d672633 commit a9c68f9
Showing 1 changed file with 23 additions and 3 deletions.
26 changes: 23 additions & 3 deletions lib/Basic/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,31 @@ else()
# Not producing a VC revision include.
set(version_inc)

# Being able to force-set the SVN revision in cases where it isn't available
# Being able to force-set the clang and llvm revision in cases where it isn't available
# is useful for performance tracking, and matches compatibility from autoconf.
if(SVN_REVISION)
set_source_files_properties(Version.cpp
PROPERTIES COMPILE_DEFINITIONS "SVN_REVISION=\"${SVN_REVISION}\"")
set_property(
SOURCE Version.cpp
APPEND
PROPERTY COMPILE_DEFINITIONS "SVN_REVISION=\"${SVN_REVISION}\"")
endif()
if(SVN_REPOSITORY)
set_property(
SOURCE Version.cpp
APPEND
PROPERTY COMPILE_DEFINITIONS "SVN_REPOSITORY=\"${SVN_REPOSITORY}\"")
endif()
if(LLVM_REVISION)
set_property(
SOURCE Version.cpp
APPEND
PROPERTY COMPILE_DEFINITIONS "LLVM_REVISION=\"${LLVM_REVISION}\"")
endif()
if(LLVM_REPOSITORY)
set_property(
SOURCE Version.cpp
APPEND
PROPERTY COMPILE_DEFINITIONS "LLVM_REPOSITORY=\"${LLVM_REPOSITORY}\"")
endif()
endif()

Expand Down

0 comments on commit a9c68f9

Please sign in to comment.