Skip to content

Commit

Permalink
fix: osx default arch
Browse files Browse the repository at this point in the history
  • Loading branch information
MistEO authored Dec 15, 2023
1 parent f96e356 commit 04b62d5
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions maadeps.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,22 @@
function(detect_maadeps_triplet outvar)
string(TOLOWER "${CMAKE_SYSTEM_NAME}" maadeps_triplet_system)
string(TOLOWER "${CMAKE_SYSTEM_PROCESSOR}" maadeps_triplet_arch)

if(maadeps_triplet_system STREQUAL "darwin")
set(maadeps_triplet_system "osx")
list(LENGTH CMAKE_OSX_ARCHITECTURES osx_archcount)
if(osx_archcount GREATER 1)
message(FATAL_ERROR "More than one CMAKE_OSX_ARCHITECTURES is not supported")
elseif(osx_archcount EQUAL 0)
message("No CMAKE_OSX_ARCHITECTURES given, default to x86_64")
set(maadeps_triplet_arch "x86_64")
message("No CMAKE_OSX_ARCHITECTURES given, default to ${maadeps_triplet_arch}")
else()
set(maadeps_triplet_arch "${CMAKE_OSX_ARCHITECTURES}")
endif()
endif()

message("maadeps_triplet_system: ${maadeps_triplet_system}")
message("maadeps_triplet_arch: ${maadeps_triplet_arch}")

if(maadeps_triplet_arch MATCHES "(amd64|x86_64)")
set(maadeps_triplet_arch "x64")
elseif(maadeps_triplet_arch MATCHES "i[3456]86")
Expand All @@ -25,6 +27,7 @@ function(detect_maadeps_triplet outvar)
else()
message(FATAL_ERROR "Unrecognized CMAKE_SYSTEM_PROCESSOR: ${CMAKE_SYSTEM_PROCESSOR}")
endif()

set(${outvar} "maa-${maadeps_triplet_arch}-${maadeps_triplet_system}" PARENT_SCOPE)
endfunction()

Expand Down

0 comments on commit 04b62d5

Please sign in to comment.