We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 004f598 + ce61434 commit 7c96aeeCopy full SHA for 7c96aee
1 file changed
tools/cmake/helpers/platform.cmake
@@ -74,20 +74,16 @@ function(get_os OS)
74
endfunction()
75
76
function(get_arch ARCH)
77
- if(ARCH_X86)
+ 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
82
set(${ARCH} "x86" PARENT_SCOPE)
- elseif(ARCH_X64)
- set(${ARCH} "x64" PARENT_SCOPE)
83
else()
- if(${CMAKE_SYSTEM_PROCESSOR} MATCHES "i386")
- set(${ARCH} "x86" PARENT_SCOPE)
84
- elseif(${CMAKE_SYSTEM_PROCESSOR} MATCHES "x86_64")
85
86
- else()
87
message(FATAL_ERROR "Unsupported architecture")
88
- endif()
89
90
-endfunction()
+ endif()
+endfunction(get_arch ARCH)
91
92
function(get_sdk SDK)
93
if(SDK_QT)
0 commit comments