From b08115a4af763abc19d4953821048938d2264173 Mon Sep 17 00:00:00 2001 From: xyb Date: Thu, 10 Sep 2020 21:13:26 +0000 Subject: [PATCH] [vcpkg] CMAKE_SYSTEM_PROCESSOR is missing if VCPKG_TARGET_ARCHITECTURE is arm or arm64. This change tries to fix issue #13395. Root cause: In script mode, cmake won't populate CMAKE_SYSTEM_PROCESSOR parameter automatically. That parameter is required by libpng to configure build parameters. To fix this issue, we need explicitly set CMAKE_SYSTEM_PROCESSOR value. Verify: On arm64-linux host, run `./vcpkg install tesseract:arm64-linux`. --- scripts/toolchains/linux.cmake | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/scripts/toolchains/linux.cmake b/scripts/toolchains/linux.cmake index f0fd6df3e0f7ab..218db5a8503009 100644 --- a/scripts/toolchains/linux.cmake +++ b/scripts/toolchains/linux.cmake @@ -10,6 +10,10 @@ elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "x86") set(CMAKE_SYSTEM_PROCESSOR x86 CACHE STRING "") string(APPEND VCPKG_C_FLAGS " -m32") string(APPEND VCPKG_CXX_FLAGS " -m32") +elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "arm") + set(CMAKE_SYSTEM_PROCESSOR armv7l CACHE STRING "") +elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "arm64") + set(CMAKE_SYSTEM_PROCESSOR aarch64 CACHE STRING "") endif() get_property( _CMAKE_IN_TRY_COMPILE GLOBAL PROPERTY IN_TRY_COMPILE )