From 4de3d4f5d90fd2245648361d5465ba2b979a4d0a Mon Sep 17 00:00:00 2001 From: Gerwin Klein Date: Thu, 27 Jan 2022 14:04:36 +1100 Subject: [PATCH] cmake: use CMAKE_HOST_APPLE instead of APPLE The CMake docs say that APPLE signifies the target system and CMAKE_HOST_APPLE the host system. Since we're picking the compiler, we want the host system. The target system likely happened to be APPLE by default on MacOS X hosts before. Signed-off-by: Gerwin Klein --- gcc.cmake | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/gcc.cmake b/gcc.cmake index f5fe097c8..c6cfe6584 100644 --- a/gcc.cmake +++ b/gcc.cmake @@ -106,13 +106,9 @@ if("${CROSS_COMPILER_PREFIX}" STREQUAL "") if("${CROSS_COMPILER_PREFIX}" STREQUAL "") # If we haven't set a target above we assume x86_64/ia32 target - if(APPLE) - # APPLE is a CMake variable that evaluates to True on a Mac OSX system - FindPrefixedGCC( - CROSS_COMPILER_PREFIX - "x86_64-linux-gnu-" - "x86_64-unknown-linux-gnu-" - ) + if(CMAKE_HOST_APPLE) + # CMAKE_HOST_APPLE is a CMake variable that evaluates to True on a Mac OSX system + FindPrefixedGCC(CROSS_COMPILER_PREFIX "x86_64-linux-gnu-" "x86_64-unknown-linux-gnu-") endif() endif() endif()