vcpkg icon indicating copy to clipboard operation
vcpkg copied to clipboard

[vcpkg scripts] Restore original intention of CMAKE_CROSSCOMPILING

Open WangWeiLin-MV opened this issue 6 months ago • 6 comments

Motivation

When cross compiling, setting CMAKE_CROSSCOMPILING to empty leads confusion.

  • The host dependency will still build
  • The port script executes cross-compile behavior since VCPKG_CROSSCOMPILING still 1(TRUE)
  • The toolchain script executes native-compile behavior with cross-compiler

So, no longer reset CMAKE_CROSSCOMPILING when cross compiling.

Impact

When the option --host-triplet is set same with target, CMAKE_CROSSCOMPILING is TRUE while VCPKG_CROSSCOMPILING is FALSE.

Previous discussion

See https://github.com/microsoft/vcpkg/issues/40474#issuecomment-2293320077

~CMake STREQUAL is case-sensitive, change ARM64 to arm64~ ~https://cmake.org/cmake/help/latest/variable/CMAKE_APPLE_SILICON_PROCESSOR.html~

WangWeiLin-MV avatar Aug 16 '24 13:08 WangWeiLin-MV