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

Commit 4234fbb

Browse files
authored
Merge pull request #481 from Vodorok/revision-as-compile-flag
Clang and llvm Revision/repository now can be specified as a compilation flag.
2 parents f39b545 + a9c68f9 commit 4234fbb

File tree

1 file changed

+23
-3
lines changed

1 file changed

+23
-3
lines changed

lib/Basic/CMakeLists.txt

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,31 @@ else()
3636
# Not producing a VC revision include.
3737
set(version_inc)
3838

39-
# Being able to force-set the SVN revision in cases where it isn't available
39+
# Being able to force-set the clang and llvm revision in cases where it isn't available
4040
# is useful for performance tracking, and matches compatibility from autoconf.
4141
if(SVN_REVISION)
42-
set_source_files_properties(Version.cpp
43-
PROPERTIES COMPILE_DEFINITIONS "SVN_REVISION=\"${SVN_REVISION}\"")
42+
set_property(
43+
SOURCE Version.cpp
44+
APPEND
45+
PROPERTY COMPILE_DEFINITIONS "SVN_REVISION=\"${SVN_REVISION}\"")
46+
endif()
47+
if(SVN_REPOSITORY)
48+
set_property(
49+
SOURCE Version.cpp
50+
APPEND
51+
PROPERTY COMPILE_DEFINITIONS "SVN_REPOSITORY=\"${SVN_REPOSITORY}\"")
52+
endif()
53+
if(LLVM_REVISION)
54+
set_property(
55+
SOURCE Version.cpp
56+
APPEND
57+
PROPERTY COMPILE_DEFINITIONS "LLVM_REVISION=\"${LLVM_REVISION}\"")
58+
endif()
59+
if(LLVM_REPOSITORY)
60+
set_property(
61+
SOURCE Version.cpp
62+
APPEND
63+
PROPERTY COMPILE_DEFINITIONS "LLVM_REPOSITORY=\"${LLVM_REPOSITORY}\"")
4464
endif()
4565
endif()
4666

0 commit comments

Comments
 (0)