Skip to content

Commit 3d8754b

Browse files
committed
add support for Linux-ARM64
1 parent 7a957b8 commit 3d8754b

File tree

1 file changed

+16
-13
lines changed

1 file changed

+16
-13
lines changed

CMake/Mathematica/FindMathematica.cmake

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -390,10 +390,12 @@ macro (_systemNameToSystemID _systemName _systemProcessor _outSystemIDs)
390390
endif()
391391
endif()
392392
elseif ("${_systemName}" STREQUAL "Linux")
393-
if ("${_systemProcessor}" MATCHES "^i.86$")
394-
set (${_outSystemIDs} "Linux")
395-
elseif ("${_systemProcessor}" MATCHES "x86_64|amd64")
393+
if ("${_systemProcessor}" MATCHES "x86_64|amd64")
396394
set (${_outSystemIDs} "Linux-x86-64")
395+
elseif ("${_systemProcessor}" MATCHES "i.86|x86")
396+
set (${_outSystemIDs} "Linux")
397+
elseif ("${_systemProcessor}" MATCHES "aarch64|arm64")
398+
set (${_outSystemIDs} "Linux-ARM64")
397399
elseif ("${_systemProcessor}" STREQUAL "ia64")
398400
set (${_outSystemIDs} "Linux-IA64")
399401
elseif ("${_systemProcessor}" MATCHES "^arm")
@@ -473,18 +475,14 @@ macro (_get_system_IDs _outSystemIDs)
473475
endif()
474476
endif()
475477
elseif (UNIX)
476-
if ("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux")
477-
# pointer size check is more reliable than CMAKE_SYSTEM_PROCESSOR
478-
if (CMAKE_SIZEOF_VOID_P EQUAL 8)
479-
set (${_outSystemIDs} "Linux-x86-64")
480-
else()
481-
set (${_outSystemIDs} "Linux")
482-
endif()
478+
_systemNameToSystemID("${CMAKE_SYSTEM_NAME}" "${CMAKE_SYSTEM_PROCESSOR}" _systemID)
479+
if (_systemID)
480+
list (APPEND ${_outSystemIDs} ${_systemID})
483481
else()
484-
_systemNameToSystemID("${CMAKE_SYSTEM_NAME}" "${CMAKE_SYSTEM_PROCESSOR}" ${_outSystemIDs})
482+
message (FATAL_ERROR "Unsupported ${CMAKE_SYSTEM_NAME} architecture ${CMAKE_SYSTEM_PROCESSOR}")
485483
endif()
486484
else()
487-
set (${_outSystemIDs} "Generic")
485+
message (FATAL_ERROR "Unsupported platform ${CMAKE_SYSTEM_NAME}")
488486
endif()
489487
list (REMOVE_DUPLICATES ${_outSystemIDs})
490488
endmacro(_get_system_IDs)
@@ -524,7 +522,12 @@ macro (_get_host_system_IDs _outSystemIDs)
524522
endmacro()
525523

526524
macro (_get_supported_systemIDs _version _outSystemIDs)
527-
if (NOT "${_version}" VERSION_LESS "12.3")
525+
if (NOT "${_version}" VERSION_LESS "13.2")
526+
set (${_outSystemIDs}
527+
"Windows-x86-64"
528+
"Linux-x86-64" "Linux-ARM64"
529+
"MacOSX-x86-64" "MacOSX-ARM64")
530+
elseif (NOT "${_version}" VERSION_LESS "12.3")
528531
set (${_outSystemIDs}
529532
"Windows-x86-64"
530533
"Linux-x86-64" "Linux-ARM"

0 commit comments

Comments
 (0)