From 4c5bd5d287da0100ddf92f98cf83764cef107a08 Mon Sep 17 00:00:00 2001 From: Bassam Tabbara Date: Tue, 4 Oct 2016 16:55:27 -0700 Subject: [PATCH] cmake: Fix for cross compiling The check for yasm tool was calling uname -m which will not work when cross compiling. Use CMAKE_SYSTEM_PROCESSOR instead. Signed-off-by: Bassam Tabbara --- src/CMakeLists.txt | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index caab0a37cd37a..389d84327bc24 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -76,11 +76,7 @@ if(no_yasm) message(STATUS " we do not have a modern/working yasm") else(no_yasm) message(STATUS " we have a modern and working yasm") - execute_process( - COMMAND uname -m - OUTPUT_VARIABLE arch - OUTPUT_STRIP_TRAILING_WHITESPACE) - if(arch MATCHES "amd64|x86_64") + if(CMAKE_SYSTEM_PROCESSOR MATCHES "amd64|x86_64") message(STATUS " we are x84_64") set(save_quiet ${CMAKE_REQUIRED_QUIET}) set(CMAKE_REQUIRED_QUIET true) @@ -108,9 +104,9 @@ else(no_yasm) else(not_arch_x32) message(STATUS " we are x32; no yasm for you") endif(not_arch_x32) - else(arch MATCHES "amd64|x86_64") + else(CMAKE_SYSTEM_PROCESSOR MATCHES "amd64|x86_64") message(STATUS " we are not x86_64 && !x32") - endif(arch MATCHES "amd64|x86_64") + endif(CMAKE_SYSTEM_PROCESSOR MATCHES "amd64|x86_64") endif(no_yasm) set(CMAKE_CXX_FLAGS "${CMAKE_C_FLAGS} -ftemplate-depth-1024 -Wno-invalid-offsetof") -- 2.39.5