diff options
author | Jacob Keeler <jacob.keeler@livioradio.com> | 2017-03-08 16:47:00 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-03-08 16:47:00 -0500 |
commit | 7c96aee655ecd0753de71cac27be8db02ce6015b (patch) | |
tree | fb40bfd364497e95994b13d3ad85e031970a2728 | |
parent | 004f598256bac01810437f7d53bb7181efd9d3ed (diff) | |
parent | ce6143434c0002e26d127d02842bac0c911b47bf (diff) | |
download | sdl_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.cmake | 18 |
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) |