Skip to content

Commit d1d13fe

Browse files
committed
Fix the bug that protoc cannot be found in cross-compilation
Change-Id: I931ff0ad1951473acd56ae3f5778ac11f7499caa
1 parent cfd38b4 commit d1d13fe

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

CMakeLists.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -429,7 +429,6 @@ if(WITH_OTLP_GRPC
429429
# Latest Protobuf imported targets and without legacy module support
430430
if(TARGET protobuf::protoc)
431431
if(CMAKE_CROSSCOMPILING AND Protobuf_PROTOC_EXECUTABLE)
432-
# Some versions of FindProtobuf.cmake uses mixed case instead of uppercase
433432
set(PROTOBUF_PROTOC_EXECUTABLE ${Protobuf_PROTOC_EXECUTABLE})
434433
else()
435434
project_build_tools_get_imported_location(PROTOBUF_PROTOC_EXECUTABLE
@@ -440,6 +439,9 @@ if(WITH_OTLP_GRPC
440439
set(PROTOBUF_PROTOC_EXECUTABLE protobuf::protoc)
441440
endif()
442441
endif()
442+
elseif(Protobuf_PROTOC_EXECUTABLE)
443+
# Some versions of FindProtobuf.cmake uses mixed case instead of uppercase
444+
set(PROTOBUF_PROTOC_EXECUTABLE ${Protobuf_PROTOC_EXECUTABLE})
443445
endif()
444446
include(CMakeDependentOption)
445447

0 commit comments

Comments
 (0)