From: Michael Gottesman Date: Tue, 20 Aug 2013 07:09:51 +0000 (+0000) Subject: [autotools->cmake] Added support for creating the clang driver plist for OS X. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=4857638fffc1ce4048d51422ce573efe8c2c8dba;p=clang [autotools->cmake] Added support for creating the clang driver plist for OS X. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@188759 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/tools/driver/CMakeLists.txt b/tools/driver/CMakeLists.txt index 77c819e70d..89778d6fc3 100644 --- a/tools/driver/CMakeLists.txt +++ b/tools/driver/CMakeLists.txt @@ -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()