From a9c68f979f623496068154c43f9cd0a556a716a6 Mon Sep 17 00:00:00 2001 From: Gabor Kutas Date: Wed, 22 Aug 2018 17:02:58 +0200 Subject: [PATCH] Clang and llvm Revision/repoitory now can be specified as compilation 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= specifies clang repository. -DLLVM_REVISION= specifies llvm revision. -DLLVM_REPOSITORY= specigies llvm repositiory. --- lib/Basic/CMakeLists.txt | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/lib/Basic/CMakeLists.txt b/lib/Basic/CMakeLists.txt index d0c9b902f67e..0c59737f8dcf 100644 --- a/lib/Basic/CMakeLists.txt +++ b/lib/Basic/CMakeLists.txt @@ -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()