From: Bassam Tabbara Date: Tue, 4 Oct 2016 23:55:27 +0000 (-0700) Subject: cmake: Fix for cross compiling X-Git-Tag: v11.1.0~674^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F11404%2Fhead;p=ceph.git 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 --- diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index caab0a37cd37..389d84327bc2 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")