aboutsummaryrefslogtreecommitdiff
path: root/cmake/macros/CheckPlatform.cmake
diff options
context:
space:
mode:
Diffstat (limited to 'cmake/macros/CheckPlatform.cmake')
-rw-r--r--cmake/macros/CheckPlatform.cmake23
1 files changed, 23 insertions, 0 deletions
diff --git a/cmake/macros/CheckPlatform.cmake b/cmake/macros/CheckPlatform.cmake
index 0f41a9c127e..c0a5185b805 100644
--- a/cmake/macros/CheckPlatform.cmake
+++ b/cmake/macros/CheckPlatform.cmake
@@ -7,6 +7,29 @@ else()
MESSAGE(STATUS "Detected 32-bit platform")
endif()
+if(CMAKE_SYSTEM_PROCESSOR MATCHES "amd64|x86_64|AMD64")
+ set(TRINITY_SYSTEM_PROCESSOR "amd64")
+elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "^(arm|ARM)64$")
+ set(TRINITY_SYSTEM_PROCESSOR "arm64")
+elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "^(arm|ARM)$")
+ set(TRINITY_SYSTEM_PROCESSOR "arm")
+else()
+ set(TRINITY_SYSTEM_PROCESSOR "x86")
+endif()
+
+# detect MSVC special case of using cmake -A switch (which doesn't set any cross compiling variables)
+if(CMAKE_GENERATOR_PLATFORM STREQUAL "Win32")
+ set(TRINITY_SYSTEM_PROCESSOR "x86")
+elseif(CMAKE_GENERATOR_PLATFORM STREQUAL "x64")
+ set(TRINITY_SYSTEM_PROCESSOR "amd64")
+elseif(CMAKE_GENERATOR_PLATFORM STREQUAL "ARM")
+ set(TRINITY_SYSTEM_PROCESSOR "arm")
+elseif(CMAKE_GENERATOR_PLATFORM STREQUAL "ARM64")
+ set(TRINITY_SYSTEM_PROCESSOR "arm64")
+endif()
+
+message(STATUS "Detected ${TRINITY_SYSTEM_PROCESSOR} processor architecture")
+
if(WIN32)
include("${CMAKE_SOURCE_DIR}/cmake/platform/win/settings.cmake")
elseif(UNIX)