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

Commit

Permalink
Merge pull request #481 from Vodorok/revision-as-compile-flag
Browse files Browse the repository at this point in the history
Clang and llvm Revision/repository now can be specified as a compilation flag.
  • Loading branch information
martong authored Aug 24, 2018
2 parents f39b545 + a9c68f9 commit 4234fbb
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 4234fbb

Please sign in to comment.