Files
TheRock/third-party/grpc/post_hook_therock-grpc.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

52 lines
1.8 KiB
CMake

# Copyright Advanced Micro Devices, Inc.
# SPDX-License-Identifier: MIT
# Platform-specific post-install patches for gRPC
if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
set(_grpc_patch_script "${CMAKE_CURRENT_LIST_DIR}/patch_install_linux.sh")
if(NOT EXISTS "${_grpc_patch_script}")
message(FATAL_ERROR "gRPC post-install patch script not found: ${_grpc_patch_script}")
endif()
set(_grpc_post_install_code [=[
set(_grpc_patch_script "@_grpc_patch_script@")
set(_cmake_command "@CMAKE_COMMAND@")
set(_working_directory "@CMAKE_CURRENT_BINARY_DIR@")
message(STATUS "Running gRPC post-install patch for ${CMAKE_INSTALL_PREFIX}")
execute_process(
COMMAND "${_cmake_command}" -E env
"THEROCK_SOURCE_DIR=@THEROCK_SOURCE_DIR@"
--
bash "${_grpc_patch_script}" "${CMAKE_INSTALL_PREFIX}"
WORKING_DIRECTORY "${_working_directory}"
RESULT_VARIABLE _grpc_patch_result
OUTPUT_VARIABLE _grpc_patch_output
ERROR_VARIABLE _grpc_patch_error
OUTPUT_STRIP_TRAILING_WHITESPACE
ERROR_STRIP_TRAILING_WHITESPACE
)
if(NOT _grpc_patch_result EQUAL 0)
message(FATAL_ERROR
"gRPC post-install patch failed with exit code ${_grpc_patch_result}\n"
"Output:\n${_grpc_patch_output}\n"
"Error:\n${_grpc_patch_error}\n")
endif()
if(_grpc_patch_output)
message(STATUS "${_grpc_patch_output}")
endif()
if(_grpc_patch_error)
message(STATUS "${_grpc_patch_error}")
endif()
]=])
string(CONFIGURE "${_grpc_post_install_code}" _grpc_post_install_code @ONLY)
install(CODE "${_grpc_post_install_code}")
elseif(CMAKE_SYSTEM_NAME STREQUAL "Windows")
# TODO: Add Windows-specific post-install patch when needed
message(STATUS "gRPC Windows post-install: no patches needed yet")
endif()