From 295b16f0362fc552b6e119381eebbeb09de7d601 Mon Sep 17 00:00:00 2001 From: Robert Adam Date: Sat, 31 Dec 2022 16:27:18 +0100 Subject: [PATCH] BUILD(cmake): Cross-compile overlay on M1 macs The overlay doesn't work on ARM Macs, so we disable it on these machines. However, the CMAKE_SYSTEM_PROCESSOR variable doesn't always hold the target architecture and as it turned out it contained the host arch on our M1 macOS builder, causing the overlay to be disabled for our x86 macOS binaries that were cross-compiled from our M1 machine. Therefore, we now leverage the system we also use to detect the target architecture for passing it as a macro to our code. --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 7632707d150..d4440a27130 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -171,7 +171,7 @@ if(g15 AND WIN32) add_subdirectory("helpers/g15helper") endif() -if(APPLE AND CMAKE_SYSTEM_PROCESSOR MATCHES "arm64") +if(APPLE AND MUMBLE_TARGET_ARCH MATCHES "arm.*") # mach_override doesn't support ARM # https://github.com/rentzsch/mach_override/issues/6 set(overlay OFF CACHE BOOL "" FORCE)