From ecb5a5fdecab81c141cc655b7af6e5fb4bbb9694 Mon Sep 17 00:00:00 2001 From: squidbus <175574877+squidbus@users.noreply.github.com> Date: Mon, 16 Sep 2024 03:24:47 -0700 Subject: [PATCH] build: Ignore macOS ARM homebrew path when cross compiling. (#922) --- CMakeLists.txt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 348d7ba9..04cb3ea7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -47,6 +47,11 @@ else() message(FATAL_ERROR "Unsupported CPU architecture: ${BASE_ARCHITECTURE}") endif() +if (APPLE AND ARCHITECTURE STREQUAL "x86_64") + # Exclude ARM homebrew path to avoid conflicts when cross compiling. + list(APPEND CMAKE_IGNORE_PREFIX_PATH "/opt/homebrew") +endif() + # This function should be passed a list of all files in a target. It will automatically generate file groups # following the directory hierarchy, so that the layout of the files in IDEs matches the one in the filesystem. function(create_target_directory_groups target_name)