[CMake] Configure the Info.plist so it contains a real version number.
authorJonas Devlieghere <jonas@devlieghere.com>
Fri, 15 Nov 2019 17:46:27 +0000 (09:46 -0800)
committerJonas Devlieghere <jonas@devlieghere.com>
Fri, 15 Nov 2019 17:50:42 +0000 (09:50 -0800)
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
lldb/tools/driver/lldb-Info.plist.in [moved from lldb/tools/driver/lldb-Info.plist with 94% similarity]
lldb/tools/lldb-vscode/CMakeLists.txt
lldb/tools/lldb-vscode/lldb-vscode-Info.plist.in [moved from lldb/tools/lldb-vscode/lldb-vscode-Info.plist with 94% similarity]

index fc10570..c31863b 100644 (file)
@@ -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
similarity index 94%
rename from lldb/tools/driver/lldb-Info.plist
rename to lldb/tools/driver/lldb-Info.plist.in
index 5a68a8b..a875129 100644 (file)
@@ -11,7 +11,7 @@
        <key>CFBundleName</key>
        <string>lldb</string>
        <key>CFBundleVersion</key>
-       <string>360.99.0</string>
+       <string>${LLDB_VERSION}</string>
        <key>SecTaskAccess</key>
        <array>
                <string>allowed</string>
index 32cb553..b527add 100644 (file)
@@ -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)
@@ -11,7 +11,7 @@
        <key>CFBundleName</key>
        <string>lldb-vscode</string>
        <key>CFBundleVersion</key>
-       <string>360.99.0</string>
+       <string>${LLDB_VERSION}</string>
        <key>SecTaskAccess</key>
        <array>
                <string>allowed</string>