File tree Expand file tree Collapse file tree 1 file changed +10
-9
lines changed
Expand file tree Collapse file tree 1 file changed +10
-9
lines changed Original file line number Diff line number Diff line change @@ -428,16 +428,17 @@ if(WITH_OTLP_GRPC
428428 endif ()
429429 # Latest Protobuf imported targets and without legacy module support
430430 if (TARGET protobuf::protoc)
431- project_build_tools_get_imported_location(PROTOBUF_PROTOC_EXECUTABLE
432- protobuf::protoc)
433- # If protobuf::protoc is not a imported target, then we use the target
434- # directly for fallback
435- if (NOT PROTOBUF_PROTOC_EXECUTABLE)
436- set (PROTOBUF_PROTOC_EXECUTABLE protobuf::protoc)
431+ if (CMAKE_CROSSCOMPILING AND Protobuf_PROTOC_EXECUTABLE)
432+ # Some versions of FindProtobuf.cmake uses mixed case instead of uppercase
433+ set (PROTOBUF_PROTOC_EXECUTABLE ${Protobuf_PROTOC_EXECUTABLE} )
434+ else ()
435+ project_build_tools_get_imported_location(PROTOBUF_PROTOC_EXECUTABLE protobuf::protoc)
436+ # If protobuf::protoc is not a imported target, then we use the target
437+ # directly for fallback
438+ if (NOT PROTOBUF_PROTOC_EXECUTABLE)
439+ set (PROTOBUF_PROTOC_EXECUTABLE protobuf::protoc)
440+ endif ()
437441 endif ()
438- elseif (Protobuf_PROTOC_EXECUTABLE)
439- # Some versions of FindProtobuf.cmake uses mixed case instead of uppercase
440- set (PROTOBUF_PROTOC_EXECUTABLE ${Protobuf_PROTOC_EXECUTABLE} )
441442 endif ()
442443 include (CMakeDependentOption)
443444
You can’t perform that action at this time.
0 commit comments