From 81104ea9ab618219b608aec8bbcba54a3c470004 Mon Sep 17 00:00:00 2001 From: Jonas Devlieghere Date: Fri, 15 Nov 2019 09:46:27 -0800 Subject: [PATCH] [CMake] Configure the Info.plist so it contains a real version number. Use CMake to configure the Info.plist file so that we have a real version number in things like crash reporter. --- lldb/tools/driver/CMakeLists.txt | 6 +++++- .../driver/{lldb-Info.plist => lldb-Info.plist.in} | 2 +- lldb/tools/lldb-vscode/CMakeLists.txt | 10 ++++++++++ ...ldb-vscode-Info.plist => lldb-vscode-Info.plist.in} | 2 +- 4 files changed, 17 insertions(+), 3 deletions(-) rename lldb/tools/driver/{lldb-Info.plist => lldb-Info.plist.in} (94%) rename lldb/tools/lldb-vscode/{lldb-vscode-Info.plist => lldb-vscode-Info.plist.in} (94%) diff --git a/lldb/tools/driver/CMakeLists.txt b/lldb/tools/driver/CMakeLists.txt index fc10570f5b69..c31863b205ca 100644 --- a/lldb/tools/driver/CMakeLists.txt +++ b/lldb/tools/driver/CMakeLists.txt @@ -3,8 +3,12 @@ tablegen(LLVM Options.inc -gen-opt-parser-defs) add_public_tablegen_target(LLDBOptionsTableGen) if(APPLE) + configure_file( + ${CMAKE_CURRENT_SOURCE_DIR}/lldb-Info.plist.in + ${CMAKE_CURRENT_BINARY_DIR}/lldb-Info.plist + ) # Inline info plist in binary (use target_link_options for this as soon as CMake 3.13 is available) - set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-sectcreate,__TEXT,__info_plist,${LLDB_SOURCE_DIR}/tools/driver/lldb-Info.plist") + set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-sectcreate,__TEXT,__info_plist,${CMAKE_CURRENT_BINARY_DIR}/lldb-Info.plist") endif() add_lldb_tool(lldb diff --git a/lldb/tools/driver/lldb-Info.plist b/lldb/tools/driver/lldb-Info.plist.in similarity index 94% rename from lldb/tools/driver/lldb-Info.plist rename to lldb/tools/driver/lldb-Info.plist.in index 5a68a8b7adb5..a875129ef296 100644 --- a/lldb/tools/driver/lldb-Info.plist +++ b/lldb/tools/driver/lldb-Info.plist.in @@ -11,7 +11,7 @@ CFBundleName lldb CFBundleVersion - 360.99.0 + ${LLDB_VERSION} SecTaskAccess allowed diff --git a/lldb/tools/lldb-vscode/CMakeLists.txt b/lldb/tools/lldb-vscode/CMakeLists.txt index 32cb55368dc2..b527addb6ba9 100644 --- a/lldb/tools/lldb-vscode/CMakeLists.txt +++ b/lldb/tools/lldb-vscode/CMakeLists.txt @@ -7,6 +7,16 @@ if (HAVE_LIBPTHREAD) list(APPEND extra_libs pthread) endif () + +if(APPLE) + configure_file( + ${CMAKE_CURRENT_SOURCE_DIR}/lldb-vscode-Info.plist.in + ${CMAKE_CURRENT_BINARY_DIR}/lldb-vscode-Info.plist + ) + # Inline info plist in binary (use target_link_options for this as soon as CMake 3.13 is available) + set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-sectcreate,__TEXT,__info_plist,${CMAKE_CURRENT_BINARY_DIR}/lldb-vscode-Info.plist") +endif() + # We need to include the llvm components we depend on manually, as liblldb does # not re-export those. set(LLVM_LINK_COMPONENTS Support) diff --git a/lldb/tools/lldb-vscode/lldb-vscode-Info.plist b/lldb/tools/lldb-vscode/lldb-vscode-Info.plist.in similarity index 94% rename from lldb/tools/lldb-vscode/lldb-vscode-Info.plist rename to lldb/tools/lldb-vscode/lldb-vscode-Info.plist.in index a6b824372546..2098e190d6ba 100644 --- a/lldb/tools/lldb-vscode/lldb-vscode-Info.plist +++ b/lldb/tools/lldb-vscode/lldb-vscode-Info.plist.in @@ -11,7 +11,7 @@ CFBundleName lldb-vscode CFBundleVersion - 360.99.0 + ${LLDB_VERSION} SecTaskAccess allowed