summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJacob Keeler <jacob.keeler@livioradio.com>2017-03-08 16:47:00 -0500
committerGitHub <noreply@github.com>2017-03-08 16:47:00 -0500
commit7c96aee655ecd0753de71cac27be8db02ce6015b (patch)
treefb40bfd364497e95994b13d3ad85e031970a2728
parent004f598256bac01810437f7d53bb7181efd9d3ed (diff)
parentce6143434c0002e26d127d02842bac0c911b47bf (diff)
downloadsdl_core-7c96aee655ecd0753de71cac27be8db02ce6015b.tar.gz
Merge pull request #1342 from LuxoftAKutsan/fix/arch_detecting_on_rasberry
Fix detecting architecture on raspberry pi
-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..961b41d689 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} "x64" 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)