Skip to content

Commit

Permalink
[vcpkg] CMAKE_SYSTEM_PROCESSOR is missing if VCPKG_TARGET_ARCHITECTUR…
Browse files Browse the repository at this point in the history
…E is arm or arm64.

This change tries to fix issue microsoft#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`.
  • Loading branch information
xieyubo committed Oct 14, 2020
1 parent 790910f commit b08115a
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions scripts/toolchains/linux.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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 )
Expand Down

0 comments on commit b08115a

Please sign in to comment.