[vcpkg] CMAKE_SYSTEM_PROCESSOR is missing if VCPKG_TARGET_ARCHITECTURE is arm or arm64. (#13465)

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`.
This commit is contained in:
xyb 2020-10-17 02:12:49 -07:00 committed by GitHub
parent a150b774a0
commit 27a2418e91
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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 )