From: Mike Stump Date: Wed, 18 Mar 2009 14:00:02 +0000 (+0000) Subject: Improve version number. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=5d023c3edee981a70d4955ac0cb22bd01817c788;p=clang Improve version number. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67204 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Driver/Driver.cpp b/lib/Driver/Driver.cpp index 0cb14886e9..fd2ff48138 100644 --- a/lib/Driver/Driver.cpp +++ b/lib/Driver/Driver.cpp @@ -212,11 +212,22 @@ void Driver::PrintOptions(const ArgList &Args) const { } void Driver::PrintVersion() const { - // FIXME: Get a reasonable version number. + static char buf[] = "$URL$"; + char *zap = strstr(buf, "/lib/Driver"); + if (zap) + *zap = 0; + zap = strstr(buf, "/clang/tools/clang"); + if (zap) + *zap = 0; + const char *vers = buf+10; // FIXME: The following handlers should use a callback mechanism, we // don't know what the client would like to do. - llvm::errs() << "ccc version 1.0" << "\n"; + llvm::errs() << "ccc version 1.0 (" << vers << ")" << "\n"; + // FIXME: Add cmake support and remove #ifdef +#ifdef TARGET_TRIPLE + llvm::errs() << "Target: " << TARGET_TRIPLE << "\n"; +#endif } bool Driver::HandleImmediateArgs(const Compilation &C) { diff --git a/lib/Driver/Makefile b/lib/Driver/Makefile index fb437d2644..4aeba9f5f8 100644 --- a/lib/Driver/Makefile +++ b/lib/Driver/Makefile @@ -12,7 +12,7 @@ LIBRARYNAME := clangDriver BUILD_ARCHIVE = 1 CXXFLAGS = -fno-rtti -CPPFLAGS += -I$(PROJ_SRC_DIR)/../../include -I$(PROJ_OBJ_DIR)/../../include +CPPFLAGS += -I$(PROJ_SRC_DIR)/../../include -I$(PROJ_OBJ_DIR)/../../include -DTARGET_TRIPLE='"$(TARGET_TRIPLE)"' include $(LEVEL)/Makefile.common