Skip to content

Commit 7c96aee

Browse files
authored
Merge pull request #1342 from LuxoftAKutsan/fix/arch_detecting_on_rasberry
Fix detecting architecture on raspberry pi
2 parents 004f598 + ce61434 commit 7c96aee

1 file changed

Lines changed: 7 additions & 11 deletions

File tree

tools/cmake/helpers/platform.cmake

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -74,20 +74,16 @@ function(get_os OS)
7474
endfunction()
7575

7676
function(get_arch ARCH)
77-
if(ARCH_X86)
77+
if( CMAKE_SIZEOF_VOID_P MATCHES 8 )
78+
# void ptr = 8 byte --> x86_64
79+
set(${ARCH} "x64" PARENT_SCOPE)
80+
elseif( CMAKE_SIZEOF_VOID_P MATCHES 4 )
81+
# void ptr = 4 byte --> x86
7882
set(${ARCH} "x86" PARENT_SCOPE)
79-
elseif(ARCH_X64)
80-
set(${ARCH} "x64" PARENT_SCOPE)
8183
else()
82-
if(${CMAKE_SYSTEM_PROCESSOR} MATCHES "i386")
83-
set(${ARCH} "x86" PARENT_SCOPE)
84-
elseif(${CMAKE_SYSTEM_PROCESSOR} MATCHES "x86_64")
85-
set(${ARCH} "x64" PARENT_SCOPE)
86-
else()
8784
message(FATAL_ERROR "Unsupported architecture")
88-
endif()
89-
endif()
90-
endfunction()
85+
endif()
86+
endfunction(get_arch ARCH)
9187

9288
function(get_sdk SDK)
9389
if(SDK_QT)

0 commit comments

Comments
 (0)