Skip to content

Commit b17ab8e

Browse files
authored
Download protobuf dependency on ARM64 build host (#24847)
Windows on ARM support AMD64 emulation, so we can use win64 version of protoc. Description Compilation on ARM64 machine fails due to missing protoc dependency. Motivation and Context With this change we can compile onnxruntime on Windows on Arm devices without setting protobuf manually. CMake will download and setup protoc dependency.
1 parent f9739c2 commit b17ab8e

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

cmake/external/onnxruntime_external_deps.cmake

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,9 @@ if(NOT ONNX_CUSTOM_PROTOC_EXECUTABLE AND NOT onnxruntime_USE_VCPKG)
132132
elseif(CMAKE_HOST_SYSTEM_PROCESSOR STREQUAL "x86")
133133
onnxruntime_fetchcontent_declare(protoc_binary URL ${DEP_URL_protoc_win32} URL_HASH SHA1=${DEP_SHA1_protoc_win32} EXCLUDE_FROM_ALL)
134134
FetchContent_Populate(protoc_binary)
135+
elseif(CMAKE_HOST_SYSTEM_PROCESSOR STREQUAL "ARM64")
136+
onnxruntime_fetchcontent_declare(protoc_binary URL ${DEP_URL_protoc_win64} URL_HASH SHA1=${DEP_SHA1_protoc_win64} EXCLUDE_FROM_ALL)
137+
FetchContent_Populate(protoc_binary)
135138
endif()
136139

137140
if(protoc_binary_SOURCE_DIR)

0 commit comments

Comments
 (0)