r257827 - [CMake] Set SVN_REVISION if CLANG_APPEND_VC_REV=On

Chris Bieneman via cfe-commits cfe-commits at lists.llvm.org
Tue Jan 19 09:15:59 PST 2016


This was my bad. The two ifs were meant to be wrapped in if(CLANG_APPEND_VC_REV), I’ve added that in r258143.

-Chris

> On Jan 18, 2016, at 11:40 AM, Craig Topper <craig.topper at gmail.com> wrote:
> 
> CLANG_APPEND_VC_REV doesn't appear to be checked anywhere. Were the two ifs supposed to check it instead of SVN_VERSION? The way it is now if the first if body executes, the second if does too since add_version_info_from_vcs sets SVN_VERSION and thus satisfies the second if.
> 
> On Mon, Jan 18, 2016 at 6:06 AM, Daniel Sanders via cfe-commits <cfe-commits at lists.llvm.org <mailto:cfe-commits at lists.llvm.org>> wrote:
> Thanks, that did the trick. I've removed the workaround from LLVMLinux.
> 
> > -----Original Message-----
> > From: cbieneman at apple.com <mailto:cbieneman at apple.com> [mailto:cbieneman at apple.com <mailto:cbieneman at apple.com>] On Behalf Of
> > Chris Bieneman
> > Sent: 15 January 2016 17:55
> > To: Daniel Sanders
> > Cc: cfe-commits at lists.llvm.org <mailto:cfe-commits at lists.llvm.org>
> > Subject: Re: r257827 - [CMake] Set SVN_REVISION if
> > CLANG_APPEND_VC_REV=On
> >
> > Thanks for the heads up. It looks like that module is was excluded from the
> > LLVM install. I’ve changed that in LLVM r257909. That change should resolve
> > your build issue. Please let me know if you continue having problems.
> >
> > Thanks,
> > -Chris
> >
> > > On Jan 15, 2016, at 5:18 AM, Daniel Sanders <Daniel.Sanders at imgtec.com <mailto:Daniel.Sanders at imgtec.com>>
> > wrote:
> > >
> > > Hi Chris,
> > >
> > > This doesn't seem to work when building clang separately from llvm.
> > LLVMLinux fails to build clang with:
> > >     CMake Error at CMakeLists.txt:104 (include):
> > >       include could not find load file:
> > >
> > >         VersionFromVCS
> > >
> > >     CMake Error at CMakeLists.txt:222 (add_version_info_from_vcs):
> > >       Unknown CMake command "add_version_info_from_vcs".
> > > See
> > http://buildbot.llvm.linuxfoundation.org/builders/13_malta/builds/383/step <http://buildbot.llvm.linuxfoundation.org/builders/13_malta/builds/383/step>
> > s/shell_3/logs/stdio for the full log.
> > >
> > > I've added a patch to llvmlinux to work around the problem for now
> > http://git.linuxfoundation.org/?p=llvmlinux.git;a=blob;f=toolchain/clang/pat <http://git.linuxfoundation.org/?p=llvmlinux.git;a=blob;f=toolchain/clang/pat>
> > ches/clang/workaround-
> > versionfromvcsbug.patch;h=848a096df37b1255575650680a266234f5d4936e;h
> > b=e0c4c72c5a008006dc230db748ea69e0d1518daf.
> > > Should we make that change to clang or fix it another way?
> > >
> > >> -----Original Message-----
> > >> From: cfe-commits [mailto:cfe-commits-bounces at lists.llvm.org <mailto:cfe-commits-bounces at lists.llvm.org>] On
> > Behalf
> > >> Of Chris Bieneman via cfe-commits
> > >> Sent: 14 January 2016 22:45
> > >> To: cfe-commits at lists.llvm.org <mailto:cfe-commits at lists.llvm.org>
> > >> Subject: r257827 - [CMake] Set SVN_REVISION if
> > >> CLANG_APPEND_VC_REV=On
> > >>
> > >> Author: cbieneman
> > >> Date: Thu Jan 14 16:45:12 2016
> > >> New Revision: 257827
> > >>
> > >> URL: http://llvm.org/viewvc/llvm-project?rev=257827&view=rev <http://llvm.org/viewvc/llvm-project?rev=257827&view=rev>
> > >> Log:
> > >> [CMake] Set SVN_REVISION if CLANG_APPEND_VC_REV=On
> > >>
> > >> This matches autoconf's ability to put clang revisions in the clang --version
> > >> spew.
> > >>
> > >> Modified:
> > >>    cfe/trunk/CMakeLists.txt
> > >>
> > >> Modified: cfe/trunk/CMakeLists.txt
> > >> URL: http://llvm.org/viewvc/llvm- <http://llvm.org/viewvc/llvm->
> > >>
> > project/cfe/trunk/CMakeLists.txt?rev=257827&r1=257826&r2=257827&view
> > >> =diff
> > >>
> > ==========================================================
> > >> ====================
> > >> --- cfe/trunk/CMakeLists.txt (original)
> > >> +++ cfe/trunk/CMakeLists.txt Thu Jan 14 16:45:12 2016
> > >> @@ -101,6 +101,7 @@ if( CMAKE_SOURCE_DIR STREQUAL CMAKE_CURR
> > >>   include(AddLLVM)
> > >>   include(TableGen)
> > >>   include(HandleLLVMOptions)
> > >> +  include(VersionFromVCS)
> > >>
> > >>   set(PACKAGE_VERSION "${LLVM_PACKAGE_VERSION}")
> > >>
> > >> @@ -213,6 +214,18 @@ if(CLANG_REPOSITORY_STRING)
> > >>   add_definitions(-
> > >> DCLANG_REPOSITORY_STRING="${CLANG_REPOSITORY_STRING}")
> > >> endif()
> > >>
> > >> +option(CLANG_APPEND_VC_REV
> > >> +  "Append the version control system revision id to clang version spew"
> > >> OFF)
> > >> +
> > >> +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}")
> > >> +endif()
> > >> +
> > >> set(CLANG_VENDOR_UTI "org.llvm.clang" CACHE STRING
> > >>   "Vendor-specific uti.")
> > >>
> > >>
> > >>
> > >> _______________________________________________
> > >> cfe-commits mailing list
> > >> cfe-commits at lists.llvm.org <mailto:cfe-commits at lists.llvm.org>
> > >> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits <http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits>
> 
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at lists.llvm.org <mailto:cfe-commits at lists.llvm.org>
> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits <http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits>
> 
> 
> 
> -- 
> ~Craig

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20160119/f1b6bb0a/attachment-0001.html>


More information about the cfe-commits mailing list