From 1bd32f0745a8cbf6d7f023b121f0123c47629d1d Mon Sep 17 00:00:00 2001 From: Jeffy Chen Date: Tue, 20 Nov 2018 12:18:57 +0800 Subject: [PATCH] [cmake]: Skip processor detection for buildroot toolchain Buildroot uses it's own toolchain.cmake, which leads to completely different CMAKE_SYSTEM_PROCESSOR settings. And buildroot's toolchain is built for specific architecture, there's no need to specify architecture features. Change-Id: I6516bc083f809b01f485db7ba92b1543c6191959 Signed-off-by: Jeffy Chen --- CMakeLists.txt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index a739abc8..d4b31df0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -73,7 +73,10 @@ enable_testing() string(TOLOWER "${CMAKE_SYSTEM_PROCESSOR}" SYSPROC) set(X86_ALIASES x86 i386 i686 x86_64 amd64) list(FIND X86_ALIASES "${SYSPROC}" X86MATCH) -if("${SYSPROC}" STREQUAL "" OR X86MATCH GREATER "-1") +if("${CMAKE_C_COMPILER}" MATCHES "-buildroot-[^/]+$") + message(STATUS "Detected Buildroot toolchain") + # Use buildroot toolchain's default architecture settings +elseif("${SYSPROC}" STREQUAL "" OR X86MATCH GREATER "-1") message(STATUS "Detected x86 system processor") set(X86 true) add_definitions(-DARCH_X86=1)