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 <bassam.tabbara@quantum.com>
This commit is contained in:
Bassam Tabbara 2016-10-04 16:55:27 -07:00
parent 3a2be4874f
commit 4c5bd5d287

View 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")