From 8ecb7bbe2babff32157b37ff6f4dda4115148fc5 Mon Sep 17 00:00:00 2001 From: Frederic Riss Date: Wed, 17 Apr 2019 18:23:22 +0000 Subject: [PATCH] [CMake] Remove Apple-specific version logic. 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 | 11 ----------- lldb/source/CMakeLists.txt | 24 +----------------------- lldb/source/lldb.cpp | 4 ---- 3 files changed, 1 insertion(+), 38 deletions(-) delete mode 100644 lldb/cmake/modules/EmbedAppleVersion.cmake diff --git a/lldb/cmake/modules/EmbedAppleVersion.cmake b/lldb/cmake/modules/EmbedAppleVersion.cmake deleted file mode 100644 index 57f5eba..0000000 --- a/lldb/cmake/modules/EmbedAppleVersion.cmake +++ /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") diff --git a/lldb/source/CMakeLists.txt b/lldb/source/CMakeLists.txt index 51c3b54..d229f74 100644 --- a/lldb/source/CMakeLists.txt +++ b/lldb/source/CMakeLists.txt @@ -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() diff --git a/lldb/source/lldb.cpp b/lldb/source/lldb.cpp index ebf8c2e..c96f5d9 100644 --- a/lldb/source/lldb.cpp +++ b/lldb/source/lldb.cpp @@ -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; -- 2.7.4