[Lldb-commits] [lldb] r352733 - Revert "[CMake] Unify scripts for generating VCS headers"

Petr Hosek via lldb-commits lldb-commits at lists.llvm.org
Wed Jan 30 23:12:43 PST 2019


Author: phosek
Date: Wed Jan 30 23:12:43 2019
New Revision: 352733

URL: http://llvm.org/viewvc/llvm-project?rev=352733&view=rev
Log:
Revert "[CMake] Unify scripts for generating VCS headers"

This reverts commits r352729 and r352731: this broke Sanitizer Windows bots

Modified:
    lldb/trunk/source/CMakeLists.txt
    lldb/trunk/source/lldb.cpp

Modified: lldb/trunk/source/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/CMakeLists.txt?rev=352733&r1=352732&r2=352733&view=diff
==============================================================================
--- lldb/trunk/source/CMakeLists.txt (original)
+++ lldb/trunk/source/CMakeLists.txt Wed Jan 30 23:12:43 2019
@@ -15,27 +15,30 @@ foreach(file
   endif()
 endforeach()
 
-set(version_inc "${CMAKE_CURRENT_BINARY_DIR}/VCSRevision.h")
-set(get_svn_script "${LLVM_CMAKE_PATH}/GenerateVersionFromVCS.cmake")
-
-if(lldb_vc)
-  set(lldb_source_dir ${LLDB_SOURCE_DIR})
+if(DEFINED lldb_vc)
+  set(version_inc "${CMAKE_CURRENT_BINARY_DIR}/SVNVersion.inc")
+  set(get_svn_script "${LLVM_CMAKE_PATH}/GetSVN.cmake")
+
+  # Create custom target to generate the VC revision include.
+  add_custom_command(OUTPUT "${version_inc}"
+    DEPENDS "${lldb_vc}" "${get_svn_script}"
+    COMMAND
+    ${CMAKE_COMMAND} "-DFIRST_SOURCE_DIR=${LLDB_SOURCE_DIR}"
+                     "-DFIRST_NAME=LLDB"
+                     "-DHEADER_FILE=${version_inc}"
+                     -P "${get_svn_script}")
+
+  # Mark the generated header as being generated.
+  set_source_files_properties("${version_inc}"
+    PROPERTIES GENERATED TRUE
+               HEADER_FILE_ONLY TRUE)
+
+  # Tell Version.cpp that it needs to build with -DHAVE_SVN_VERSION_INC.
+  set_property(SOURCE lldb.cpp APPEND PROPERTY 
+               COMPILE_DEFINITIONS "HAVE_SVN_VERSION_INC")
+  list(APPEND lldbBase_SOURCES ${version_inc})
 endif()
 
-add_custom_command(OUTPUT "${version_inc}"
-  DEPENDS "${lldb_vc}" "${get_svn_script}"
-  COMMAND ${CMAKE_COMMAND} "-DNAMES=LLDB"
-                           "-DLLDB_SOURCE_DIR=${LLDB_SOURCE_DIR}"
-                           "-DHEADER_FILE=${version_inc}"
-                           -P "${get_svn_script}")
-
-# Mark the generated header as being generated.
-set_source_files_properties("${version_inc}"
-  PROPERTIES GENERATED TRUE
-             HEADER_FILE_ONLY TRUE)
-
-list(APPEND lldbBase_SOURCES ${version_inc})
-
 if(APPLE)
   set(apple_version_inc "${CMAKE_CURRENT_BINARY_DIR}/AppleVersion.inc")
   set(apple_version_script "${LLDB_SOURCE_DIR}/cmake/modules/EmbedAppleVersion.cmake")

Modified: lldb/trunk/source/lldb.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/lldb.cpp?rev=352733&r1=352732&r2=352733&view=diff
==============================================================================
--- lldb/trunk/source/lldb.cpp (original)
+++ lldb/trunk/source/lldb.cpp Wed Jan 30 23:12:43 2019
@@ -11,9 +11,12 @@
 using namespace lldb;
 using namespace lldb_private;
 
-#include "VCSRevision.h"
 #include "clang/Basic/Version.h"
 
+#ifdef HAVE_SVN_VERSION_INC
+#include "SVNVersion.inc"
+#endif
+
 #ifdef HAVE_APPLE_VERSION_INC
 #include "AppleVersion.inc"
 #endif




More information about the lldb-commits mailing list