Files
TheRock/compiler/amd-llvm/clang-tools-extra/clangd/xpc/cmake/modules/CreateClangdXPCFramework.cmake
T
derek.holloway 7502bf64a4
CodeQL / Analyze (actions) (push) Canceled after 0s
CodeQL / Analyze (python) (push) Canceled after 0s
pre-commit / pre-commit (push) Canceled after 0s
Multi-Arch CI / setup (push) Canceled after 0s
Publish build_manylinux_x86_64 images / publish_build_manylinux_x86_64 (push) Canceled after 0s
Setup (Multi-Arch) / setup (push) Canceled after 0s
Multi-Arch CI / Linux::${{ fromJSON(needs.setup.outputs.linux_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubi10 image / publish_no_rocm_image_ubi10 (push) Canceled after 0s
Multi-Arch CI / Windows::${{ fromJSON(needs.setup.outputs.windows_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Multi-Arch CI / Manifest Diff (push) Canceled after 0s
TheRock Manifest Diff Report / Generate Manifest Diff Report (push) Canceled after 0s
Multi-Arch CI / CI Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_ocl_rt images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_rocgdb images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Unit Tests / Unit Tests :: ubuntu-24.04 (push) Canceled after 0s
Unit Tests / Unit Tests :: windows-2022 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_media (push) Canceled after 0s
Unit Tests / Unit Tests Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_openmpi (push) Canceled after 0s
Flatten subprojects into a single base monorepo
2026-09-02 16:34:47 -07:00

85 lines
2.9 KiB
CMake

# Creates the ClangdXPC framework.
macro(create_clangd_xpc_framework target name)
set(CLANGD_FRAMEWORK_LOCATION "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${name}.framework")
set(CLANGD_FRAMEWORK_OUT_LOCATION "${CLANGD_FRAMEWORK_LOCATION}/Versions/A")
# Create the framework info PLIST.
set(CLANGD_XPC_FRAMEWORK_NAME "${name}")
configure_file(
"${CLANGD_XPC_SOURCE_DIR}/cmake/Info.plist.in"
"${CLANGD_XPC_BINARY_DIR}/${name}.Info.plist")
set(CLANGD_XPC_SERVICE_NAME "clangd")
set(CLANGD_XPC_SERVICE_OUT_LOCATION
"${CLANGD_FRAMEWORK_OUT_LOCATION}/XPCServices/${CLANGD_XPC_SERVICE_NAME}.xpc/Contents")
# Create the XPC service info PLIST.
set(CLANGD_XPC_SERVICE_BUNDLE_NAME "org.llvm.${CLANGD_XPC_SERVICE_NAME}")
configure_file(
"${CLANGD_XPC_SOURCE_DIR}/cmake/XPCServiceInfo.plist.in"
"${CLANGD_XPC_BINARY_DIR}/${name}Service.Info.plist")
# Create the custom command
add_custom_command(OUTPUT ${CLANGD_FRAMEWORK_LOCATION}
# Copy the PLIST.
COMMAND ${CMAKE_COMMAND} -E copy
"${CLANGD_XPC_BINARY_DIR}/${name}.Info.plist"
"${CLANGD_FRAMEWORK_OUT_LOCATION}/Resources/Info.plist"
# Copy the framework binary.
COMMAND ${CMAKE_COMMAND} -E copy
"$<TARGET_FILE:${target}>"
"${CLANGD_FRAMEWORK_OUT_LOCATION}/${name}"
# Copy the XPC Service PLIST.
COMMAND ${CMAKE_COMMAND} -E copy
"${CLANGD_XPC_BINARY_DIR}/${name}Service.Info.plist"
"${CLANGD_XPC_SERVICE_OUT_LOCATION}/Info.plist"
# Copy the Clangd binary.
COMMAND ${CMAKE_COMMAND} -E copy
"$<TARGET_FILE:clangd>"
"${CLANGD_XPC_SERVICE_OUT_LOCATION}/MacOS/clangd"
COMMAND ${CMAKE_COMMAND} -E create_symlink "A"
"${CLANGD_FRAMEWORK_LOCATION}/Versions/Current"
COMMAND ${CMAKE_COMMAND} -E create_symlink
"Versions/Current/Resources"
"${CLANGD_FRAMEWORK_LOCATION}/Resources"
COMMAND ${CMAKE_COMMAND} -E create_symlink
"Versions/Current/XPCServices"
"${CLANGD_FRAMEWORK_LOCATION}/XPCServices"
COMMAND ${CMAKE_COMMAND} -E create_symlink
"Versions/Current/${name}"
"${CLANGD_FRAMEWORK_LOCATION}/${name}"
DEPENDS
"${CLANGD_XPC_BINARY_DIR}/${name}.Info.plist"
"${CLANGD_XPC_BINARY_DIR}/${name}Service.Info.plist"
clangd
COMMENT "Creating ClangdXPC framework"
VERBATIM
)
add_custom_target(
ClangdXPC
DEPENDS
${target}
${CLANGD_FRAMEWORK_LOCATION}
)
set_property(
TARGET ClangdXPC
APPEND
PROPERTY ADDITIONAL_CLEAN_FILES ${CLANGD_FRAMEWORK_LOCATION}
)
# clangd is already signed as a standalone executable, so it must be forced.
llvm_codesign(ClangdXPC BUNDLE_PATH "${CLANGD_FRAMEWORK_OUT_LOCATION}/XPCServices/${CLANGD_XPC_SERVICE_NAME}.xpc/" FORCE)
# ClangdXPC library is already signed as a standalone library, so it must be forced.
llvm_codesign(ClangdXPC BUNDLE_PATH "${CLANGD_FRAMEWORK_LOCATION}" FORCE)
endmacro(create_clangd_xpc_framework)