From fac5905e557f85706b2a96d39cad2977712c3225 Mon Sep 17 00:00:00 2001 From: Chris Bieneman Date: Tue, 19 Jan 2016 17:06:12 +0000 Subject: [PATCH] [CMake] Properly respect the CLANG_APPEND_VC_REV option Only set -DSVN_REVISION if CLANG_APPEND_VC_REV=On llvm-svn: 258143 --- clang/CMakeLists.txt | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/clang/CMakeLists.txt b/clang/CMakeLists.txt index 548201702911..861fa964f22f 100644 --- a/clang/CMakeLists.txt +++ b/clang/CMakeLists.txt @@ -216,14 +216,15 @@ endif() option(CLANG_APPEND_VC_REV "Append the version control system revision id to clang version spew" OFF) +if(CLANG_APPEND_VC_REV) + if(NOT SVN_REVISION) + # This macro will set SVN_REVISION in the parent scope + add_version_info_from_vcs(VERSION_VAR) + endif() -if(NOT SVN_REVISION) - # This macro will set SVN_REVISION in the parent scope - add_version_info_from_vcs(VERSION_VAR) -endif() - -if(SVN_REVISION) - add_definitions(-DSVN_REVISION="${SVN_REVISION}") + if(SVN_REVISION) + add_definitions(-DSVN_REVISION="${SVN_REVISION}") + endif() endif() set(CLANG_VENDOR_UTI "org.llvm.clang" CACHE STRING