Advertisement
AntonyZhilin

Untitled

Jun 1st, 2023
1,309
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
CMake 0.79 KB | None | 0 0
  1.   if(NOT UserverGrpc_VERSION)
  2.     try_run(
  3.         gRPC_GET_VERSION_RUN_STATUS
  4.         gRPC_GET_VERSION_COMPILE_STATUS
  5.         "${CMAKE_CURRENT_BINARY_DIR}"
  6.         "${CMAKE_CURRENT_LIST_DIR}/get_gRPC_version.cpp"
  7.         LINK_LIBRARIES UserverGrpc
  8.         COMPILE_OUTPUT_VARIABLE gRPC_GET_VERSION_COMPILE_OUTPUT
  9.         RUN_OUTPUT_VARIABLE UserverGrpc_VERSION
  10.     )
  11.     if(NOT gRPC_GET_VERSION_COMPILE_STATUS)
  12.       message(
  13.           FATAL_ERROR
  14.           "Failed to compile a gRPC version test binary: "
  15.           "${gRPC_GET_VERSION_COMPILE_OUTPUT}"
  16.       )
  17.     elseif(NOT gRPC_GET_VERSION_RUN_STATUS EQUAL 0)
  18.       message(
  19.           FATAL_ERROR
  20.           "Failed to run a gRPC version test binary, "
  21.           "status=${gRPC_GET_VERSION_RUN_STATUS}"
  22.       )
  23.     endif()
  24.   endif()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement