Skip to content

Commit

Permalink
Fix the bug that protoc cannot be found in cross-compilation
Browse files Browse the repository at this point in the history
Change-Id: I931ff0ad1951473acd56ae3f5778ac11f7499caa
  • Loading branch information
seanchann committed Dec 5, 2024
1 parent cfd38b4 commit d1d13fe
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,6 @@ if(WITH_OTLP_GRPC
# Latest Protobuf imported targets and without legacy module support
if(TARGET protobuf::protoc)
if(CMAKE_CROSSCOMPILING AND Protobuf_PROTOC_EXECUTABLE)
# Some versions of FindProtobuf.cmake uses mixed case instead of uppercase
set(PROTOBUF_PROTOC_EXECUTABLE ${Protobuf_PROTOC_EXECUTABLE})
else()
project_build_tools_get_imported_location(PROTOBUF_PROTOC_EXECUTABLE
Expand All @@ -440,6 +439,9 @@ if(WITH_OTLP_GRPC
set(PROTOBUF_PROTOC_EXECUTABLE protobuf::protoc)
endif()
endif()
elseif(Protobuf_PROTOC_EXECUTABLE)
# Some versions of FindProtobuf.cmake uses mixed case instead of uppercase
set(PROTOBUF_PROTOC_EXECUTABLE ${Protobuf_PROTOC_EXECUTABLE})
endif()
include(CMakeDependentOption)

Expand Down

0 comments on commit d1d13fe

Please sign in to comment.