]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
cmake: Fix for cross compiling 11404/head
authorBassam Tabbara <bassam.tabbara@quantum.com>
Tue, 4 Oct 2016 23:55:27 +0000 (16:55 -0700)
committerBassam Tabbara <bassam.tabbara@quantum.com>
Mon, 10 Oct 2016 21:41:55 +0000 (14:41 -0700)
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 <bassam.tabbara@quantum.com>
src/CMakeLists.txt

index caab0a37cd37a93bb77e5e7c139a4577a15b8769..389d84327bc24a66523b8ab017668f7d72b88631 100644 (file)
@@ -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")