[PATCH] D68846: Do the bare minimum to get ClangdXPC.framework building with CMake's Xcode generator

Jordan Rose via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Oct 10 17:59:01 PDT 2019


jordan_rose created this revision.
jordan_rose added reviewers: beanz, jkorous.
Herald added subscribers: cfe-commits, usaxena95, kadircet, arphaman, dexonsmith, MaskRay, ilya-biryukov, mgorny.
Herald added a project: clang.

The output directories for CMake's Xcode project generator are specific to the configuration, and so looking in `CMAKE_LIBRARY_OUTPUT_DIRECTORY` isn't going to work. Fortunately, CMake already provides generator expressions to find the output of a given target.

I call this the bare minimum because the //built// framework isn't going to respect the configuration; that is, I can't have both Debug and RelWithDebInfo variants of ClangdXPC.framework at the same time like I can with normal library or executable targets. To do that we'd have to put the framework in a configuration-specific output directory too…or use CMake's native support for frameworks instead.


Repository:
  rCTE Clang Tools Extra

https://reviews.llvm.org/D68846

Files:
  clang-tools-extra/clangd/xpc/cmake/modules/CreateClangdXPCFramework.cmake


Index: clang-tools-extra/clangd/xpc/cmake/modules/CreateClangdXPCFramework.cmake
===================================================================
--- clang-tools-extra/clangd/xpc/cmake/modules/CreateClangdXPCFramework.cmake
+++ clang-tools-extra/clangd/xpc/cmake/modules/CreateClangdXPCFramework.cmake
@@ -28,7 +28,7 @@
 
     # Copy the framework binary.
     COMMAND ${CMAKE_COMMAND} -E copy
-       "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/lib${target}.dylib"
+       "$<TARGET_FILE:${target}>"
        "${CLANGD_FRAMEWORK_OUT_LOCATION}/${name}"
 
     # Copy the XPC Service PLIST.
@@ -38,7 +38,7 @@
 
     # Copy the Clangd binary.
     COMMAND ${CMAKE_COMMAND} -E copy
-      "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/clangd"
+      "$<TARGET_FILE:clangd>"
       "${CLANGD_XPC_SERVICE_OUT_LOCATION}/MacOS/clangd"
 
      COMMAND ${CMAKE_COMMAND} -E create_symlink "A"


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D68846.224511.patch
Type: text/x-patch
Size: 865 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20191011/15a422ff/attachment.bin>


More information about the cfe-commits mailing list