|
|
@@ -86,10 +86,12 @@ endif()
|
|
|
set(X86 FALSE)
|
|
|
set(ARM FALSE)
|
|
|
if(GCC OR CLANG)
|
|
|
- if(${CMAKE_SYSTEM_PROCESSOR} MATCHES "x86")
|
|
|
- set(X86 TRUE)
|
|
|
- elseif(${CMAKE_SYSTEM_PROCESSOR} MATCHES "aarch")
|
|
|
+ execute_process(COMMAND ${CMAKE_C_COMPILER} -dumpmachine OUTPUT_VARIABLE target_arch)
|
|
|
+
|
|
|
+ if(${CMAKE_SYSTEM_PROCESSOR} MATCHES "aarch" OR ${target_arch} MATCHES "aarch")
|
|
|
set(ARM TRUE)
|
|
|
+ elseif(${CMAKE_SYSTEM_PROCESSOR} MATCHES "x86")
|
|
|
+ set(X86 TRUE)
|
|
|
else()
|
|
|
message(FATAL_ERROR "Couldn't find the target architecture from: ${target_arch}")
|
|
|
endif()
|