From b9fc23ff3aabbbef229d0b9ff003d6459123ba7e Mon Sep 17 00:00:00 2001 From: Alexander Kutsan Date: Thu, 2 Mar 2017 09:50:10 +0000 Subject: [PATCH 1/3] Fix detecting arhitecture on raspberry pi Detect arhotecture depending on size of void Related to #1329 --- tools/cmake/helpers/platform.cmake | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/tools/cmake/helpers/platform.cmake b/tools/cmake/helpers/platform.cmake index a377dfd042b..023cd7e8791 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) From dfb6417649146f59b441ab8b227cff65a97d7bda Mon Sep 17 00:00:00 2001 From: Alex Kutsan Date: Fri, 3 Mar 2017 12:49:31 +0200 Subject: [PATCH 2/3] Set ARCH to x64 against x86_64 --- tools/cmake/helpers/platform.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/cmake/helpers/platform.cmake b/tools/cmake/helpers/platform.cmake index 023cd7e8791..14a29a67a87 100644 --- a/tools/cmake/helpers/platform.cmake +++ b/tools/cmake/helpers/platform.cmake @@ -76,7 +76,7 @@ endfunction() function(get_arch ARCH) if( CMAKE_SIZEOF_VOID_P MATCHES 8 ) # void ptr = 8 byte --> x86_64 - set(${ARCH} "x86_64" PARENT_SCOPE) + set(${ARCH} "x86" PARENT_SCOPE) elseif( CMAKE_SIZEOF_VOID_P MATCHES 4 ) # void ptr = 4 byte --> x86 set(${ARCH} "x86" PARENT_SCOPE) From ce6143434c0002e26d127d02842bac0c911b47bf Mon Sep 17 00:00:00 2001 From: Alex Kutsan Date: Mon, 6 Mar 2017 16:44:12 +0200 Subject: [PATCH 3/3] Fixed typo x86 -> x64 --- tools/cmake/helpers/platform.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/cmake/helpers/platform.cmake b/tools/cmake/helpers/platform.cmake index 14a29a67a87..961b41d6897 100644 --- a/tools/cmake/helpers/platform.cmake +++ b/tools/cmake/helpers/platform.cmake @@ -76,7 +76,7 @@ endfunction() function(get_arch ARCH) if( CMAKE_SIZEOF_VOID_P MATCHES 8 ) # void ptr = 8 byte --> x86_64 - set(${ARCH} "x86" PARENT_SCOPE) + set(${ARCH} "x64" PARENT_SCOPE) elseif( CMAKE_SIZEOF_VOID_P MATCHES 4 ) # void ptr = 4 byte --> x86 set(${ARCH} "x86" PARENT_SCOPE)