summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Kutsan <akutsan@luxoft.com>2017-03-02 09:50:10 +0000
committerAlexander Kutsan <akutsan@luxoft.com>2017-03-02 09:50:10 +0000
commitb9fc23ff3aabbbef229d0b9ff003d6459123ba7e (patch)
treeda0277a3e9241682f5a60a5041eaf43544742f3e
parent01ddf8ce5de00de85a2f0eb37a313053167217bc (diff)
downloadsdl_core-b9fc23ff3aabbbef229d0b9ff003d6459123ba7e.tar.gz
Fix detecting arhitecture on raspberry pi
Detect arhotecture depending on size of void Related to #1329
-rw-r--r--tools/cmake/helpers/platform.cmake18
1 files changed, 7 insertions, 11 deletions
diff --git a/tools/cmake/helpers/platform.cmake b/tools/cmake/helpers/platform.cmake
index a377dfd042..023cd7e879 100644
--- a/tools/cmake/helpers/platform.cmake
+++ b/tools/cmake/helpers/platform.cmake
@@ -74,20 +74,16 @@ function(get_os OS)
endfunction()
function(get_arch ARCH)
- if(ARCH_X86)
+ if( CMAKE_SIZEOF_VOID_P MATCHES 8 )
+ # void ptr = 8 byte --> x86_64
+ set(${ARCH} "x86_64" PARENT_SCOPE)
+ elseif( CMAKE_SIZEOF_VOID_P MATCHES 4 )
+ # void ptr = 4 byte --> x86
set(${ARCH} "x86" PARENT_SCOPE)
- elseif(ARCH_X64)
- set(${ARCH} "x64" PARENT_SCOPE)
else()
- if(${CMAKE_SYSTEM_PROCESSOR} MATCHES "i386")
- set(${ARCH} "x86" PARENT_SCOPE)
- elseif(${CMAKE_SYSTEM_PROCESSOR} MATCHES "x86_64")
- set(${ARCH} "x64" PARENT_SCOPE)
- else()
message(FATAL_ERROR "Unsupported architecture")
- endif()
- endif()
-endfunction()
+ endif()
+endfunction(get_arch ARCH)
function(get_sdk SDK)
if(SDK_QT)