aboutsummaryrefslogtreecommitdiff
path: root/scripts/toolchains/linux.cmake
diff options
context:
space:
mode:
authorxyb <xyb@xyb.name>2020-10-17 02:12:49 -0700
committerGitHub <noreply@github.com>2020-10-17 02:12:49 -0700
commit27a2418e91179d8607862348d7b498558e98a0ab (patch)
tree264a65b18d7a8ef03a1b4d5226040aadeb170a41 /scripts/toolchains/linux.cmake
parenta150b774a0d7b1bb7ede7e9f69be2340e54a7914 (diff)
downloadvcpkg-27a2418e91179d8607862348d7b498558e98a0ab.tar.gz
vcpkg-27a2418e91179d8607862348d7b498558e98a0ab.zip
[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`.
Diffstat (limited to 'scripts/toolchains/linux.cmake')
-rw-r--r--scripts/toolchains/linux.cmake4
1 files changed, 4 insertions, 0 deletions
diff --git a/scripts/toolchains/linux.cmake b/scripts/toolchains/linux.cmake
index f0fd6df3e..218db5a85 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 )