From 5dc97b0df1a3f8c91cb05bb57aa7b1e4f5aa30ab Mon Sep 17 00:00:00 2001 From: Pierre Wendling Date: Tue, 6 Jun 2023 03:16:24 -0400 Subject: [PATCH 1/2] Set the correct arch for arm64. The triple should use aarch64 instead of arm64. --- cmake/GetTriplet.cmake | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/cmake/GetTriplet.cmake b/cmake/GetTriplet.cmake index 5d152c5..582e200 100644 --- a/cmake/GetTriplet.cmake +++ b/cmake/GetTriplet.cmake @@ -2,9 +2,10 @@ function(get_host_triplet triplet) set(host_arch ${CMAKE_SYSTEM_PROCESSOR}) if(host_arch STREQUAL "x86") set(host_arch "i686") - endif() - if(host_arch STREQUAL "amd64") + elseif(host_arch STREQUAL "amd64") set(host_arch "x86_64") + elseif(host_arch STREQUAL "arm64") + set(host_arch "aarch64") endif() if(${CMAKE_SYSTEM_NAME} STREQUAL "Linux") @@ -31,9 +32,10 @@ function(get_build_triplet triplet) set(host_arch ${CMAKE_HOST_SYSTEM_PROCESSOR}) if(host_arch STREQUAL "x86") set(host_arch "i686") - endif() - if(host_arch STREQUAL "amd64") + elseif(host_arch STREQUAL "amd64") set(host_arch "x86_64") + elseif(host_arch STREQUAL "arm64") + set(host_arch "aarch64") endif() if(${CMAKE_HOST_SYSTEM_NAME} STREQUAL "Linux") From 83f245a627a8112c0af77ad1d8b780226021e136 Mon Sep 17 00:00:00 2001 From: Pierre Wendling Date: Wed, 7 Jun 2023 02:25:36 -0400 Subject: [PATCH 2/2] Ensure the system arch is lowercase. On Windows, `CMAKE_SYSTEM_PROCESSOR` can return AMD64, which fails the current check. --- cmake/GetTriplet.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmake/GetTriplet.cmake b/cmake/GetTriplet.cmake index 582e200..7bb251d 100644 --- a/cmake/GetTriplet.cmake +++ b/cmake/GetTriplet.cmake @@ -1,5 +1,5 @@ function(get_host_triplet triplet) - set(host_arch ${CMAKE_SYSTEM_PROCESSOR}) + string(TOLOWER "${CMAKE_SYSTEM_PROCESSOR}" host_arch) if(host_arch STREQUAL "x86") set(host_arch "i686") elseif(host_arch STREQUAL "amd64") @@ -29,7 +29,7 @@ function(get_host_triplet triplet) endfunction() function(get_build_triplet triplet) - set(host_arch ${CMAKE_HOST_SYSTEM_PROCESSOR}) + string(TOLOWER "${CMAKE_HOST_SYSTEM_PROCESSOR}" host_arch) if(host_arch STREQUAL "x86") set(host_arch "i686") elseif(host_arch STREQUAL "amd64")