[CMake] Remove Apple-specific version logic.
authorFrederic Riss <friss@apple.com>
Wed, 17 Apr 2019 18:23:22 +0000 (18:23 +0000)
committerFrederic Riss <friss@apple.com>
Wed, 17 Apr 2019 18:23:22 +0000 (18:23 +0000)
We were using the LLDB-Info.plist as the canonical holder of the
version number, but there is really no good reason to do this. If
anything the plist should be generated using the information provided
to CMake.

For now just remove the logic extracting the version from the plist
and rely on LLDB_VERSION_STRING.

llvm-svn: 358604

lldb/cmake/modules/EmbedAppleVersion.cmake [deleted file]
lldb/source/CMakeLists.txt
lldb/source/lldb.cpp

diff --git a/lldb/cmake/modules/EmbedAppleVersion.cmake b/lldb/cmake/modules/EmbedAppleVersion.cmake
deleted file mode 100644 (file)
index 57f5eba..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-execute_process(COMMAND /usr/libexec/PlistBuddy -c "Print:CFBundleVersion" ${LLDB_INFO_PLIST}
-                OUTPUT_VARIABLE BundleVersion
-                OUTPUT_STRIP_TRAILING_WHITESPACE)
-
-file(APPEND "${HEADER_FILE}.tmp"
-    "#define LLDB_VERSION_STRING lldb-${BundleVersion}\n")
-
-execute_process(COMMAND ${CMAKE_COMMAND} -E copy_if_different
-  "${HEADER_FILE}.tmp" "${HEADER_FILE}")
-
-file(REMOVE "${HEADER_FILE}.tmp")
index 51c3b54..d229f74 100644 (file)
@@ -39,29 +39,7 @@ set_property(SOURCE lldb.cpp APPEND PROPERTY
 
 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")
-  set(info_plist ${LLDB_SOURCE_DIR}/resources/LLDB-Info.plist)
-
-  # Create custom target to generate the VC revision include.
-  add_custom_command(OUTPUT "${apple_version_inc}"
-    DEPENDS "${apple_version_script}" "${info_plist}"
-    COMMAND
-    ${CMAKE_COMMAND} "-DLLDB_INFO_PLIST=${info_plist}"
-                     "-DHEADER_FILE=${apple_version_inc}"
-                     -P "${apple_version_script}")
-
-  # Mark the generated header as being generated.
-  set_source_files_properties("${apple_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_APPLE_VERSION_INC")
-  list(APPEND lldbBase_SOURCES ${apple_version_inc})
-elseif(LLDB_VERSION_STRING)
+if(LLDB_VERSION_STRING)
   set_property(SOURCE lldb.cpp APPEND PROPERTY
                COMPILE_DEFINITIONS "LLDB_VERSION_STRING=${LLDB_VERSION_STRING}")
 endif()
index ebf8c2e..c96f5d9 100644 (file)
@@ -17,10 +17,6 @@ using namespace lldb_private;
 #include "VCSVersion.inc"
 #endif
 
-#ifdef HAVE_APPLE_VERSION_INC
-#include "AppleVersion.inc"
-#endif
-
 static const char *GetLLDBRevision() {
 #ifdef LLDB_REVISION
   return LLDB_REVISION;