]> granicus.if.org Git - clang/commitdiff
Improve version number.
authorMike Stump <mrs@apple.com>
Wed, 18 Mar 2009 14:00:02 +0000 (14:00 +0000)
committerMike Stump <mrs@apple.com>
Wed, 18 Mar 2009 14:00:02 +0000 (14:00 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67204 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Driver/Driver.cpp
lib/Driver/Makefile

index 0cb14886e90f0fafbe140c7a0766c56f7abce2c1..fd2ff4813824207d361bc225b4f7b53cd81da31c 100644 (file)
@@ -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) {
index fb437d2644cf4bfec44ba0c6871c3b68d5c5f037..4aeba9f5f8dc02f5d789691abf861c55dc141459 100644 (file)
@@ -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