Skip to content

Commit

Permalink
BUILD(cmake): Cross-compile overlay on M1 macs
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Krzmbrzl committed Dec 31, 2022
1 parent bde29b6 commit 295b16f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 295b16f

Please sign in to comment.