]> granicus.if.org Git - clang/commitdiff
[autotools->cmake] Added support for creating the clang driver plist for OS X.
authorMichael Gottesman <mgottesman@apple.com>
Tue, 20 Aug 2013 07:09:51 +0000 (07:09 +0000)
committerMichael Gottesman <mgottesman@apple.com>
Tue, 20 Aug 2013 07:09:51 +0000 (07:09 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@188759 91177308-0d34-0410-b5e6-96231b3b80d8

tools/driver/CMakeLists.txt

index 77c819e70d205104edd493e27b1771633702e280..89778d6fc34dc825ec8290d9b3d6e6324d375a66 100644 (file)
@@ -89,3 +89,30 @@ install(TARGETS clang
 
 # Create the clang++ and clang-cl symlinks at installation time.
 install(SCRIPT clang_symlink.cmake -DCMAKE_INSTALL_PREFIX=\"${CMAKE_INSTALL_PREFIX}\")
+
+# Configure plist creation for OS X.
+set (TOOL_INFO_PLIST "Info.plist" CACHE STRING "Plist name")
+if (APPLE)  
+  if (CLANG_VENDOR)
+    set(TOOL_INFO_NAME "${CLANG_VENDOR} clang")
+  else()
+    set(TOOL_INFO_NAME "clang")
+  endif()
+
+  set(TOOL_INFO_UTI "${CLANG_VENDOR_UTI}")
+  set(TOOL_INFO_VERSION "${CLANG_VERSION}")
+  if (LLVM_SUBMIT_VERSION)
+    set(TOOL_INFO_BUILD_VERSION
+      "${LLVM_SUBMIT_VERSION}.${LLVM_SUBMIT_SUBVERSION}")
+  endif()
+  
+  set(TOOL_INFO_PLIST_OUT "${CMAKE_CURRENT_BINARY_DIR}/${TOOL_INFO_PLIST}")
+  target_link_libraries(clang
+    "-Wl,-sectcreate,__TEXT,__info_plist,${TOOL_INFO_PLIST_OUT}")
+  configure_file("${TOOL_INFO_PLIST}.in" "${TOOL_INFO_PLIST_OUT}" @ONLY)
+  
+  set(TOOL_INFO_UTI)
+  set(TOOL_INFO_NAME)
+  set(TOOL_INFO_VERSION)
+  set(TOOL_INFO_BUILD_VERSION)
+endif()