Skip to content

Commit

Permalink
Set llvm_host_triple for cross-compiling macOS (#1004)
Browse files Browse the repository at this point in the history
Since the build artifact for the cross-compiled arm build should run on an arm host, set the host variable instead of the default target triple variable
  • Loading branch information
Ninja3047 authored Jan 13, 2023
1 parent 3430e60 commit 2adea3b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions ports/llvm-15/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -294,9 +294,9 @@ set(LLVM_LINK_JOBS 2)

# Cross compilation for M1
if (VCPKG_TARGET_IS_OSX)
set(LLVM_DEFAULT_TARGET_TRIPLE "${VCPKG_OSX_ARCHITECTURES}-apple-darwin")
list(APPEND OPTIONS "-DLLVM_DEFAULT_TARGET_TRIPLE=${LLVM_DEFAULT_TARGET_TRIPLE}")
message(STATUS "Default target triple ${LLVM_DEFAULT_TARGET_TRIPLE}")
set(LLVM_HOST_TRIPLE "${VCPKG_OSX_ARCHITECTURES}-apple-darwin")
list(APPEND OPTIONS "-DLLVM_HOST_TRIPLE=${LLVM_HOST_TRIPLE}")
message(STATUS "Default host triple ${LLVM_HOST_TRIPLE}")
endif()

if (VCPKG_TARGET_ARCHITECTURE STREQUAL "arm64")
Expand Down

0 comments on commit 2adea3b

Please sign in to comment.