Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Werner <stewreo@gmail.com>2020-11-26 13:30:53 +0300
committerStefan Werner <stewreo@gmail.com>2020-11-26 13:30:53 +0300
commit05f410dd849eb2cb46648ef4197386ae7f52d32c (patch)
tree158fd90bf4acaf11749ab924cbf8f229f469fa14 /build_files
parent8a2270efc52a5f9de1255475ee069288ceca4195 (diff)
macOS: Added new location for Homebrew.
The build script for macOS dependencies expects to find bison provided by Homebrew under /usr/local. Since the default install location for Homebrew changes on macOS/ARM, the script now looks at the host architecture and switches to /opt/homebrew on Macs with Apple Silicon.
Diffstat (limited to 'build_files')
-rw-r--r--build_files/build_environment/cmake/check_software.cmake8
-rw-r--r--build_files/build_environment/cmake/ispc.cmake7
2 files changed, 13 insertions, 2 deletions
diff --git a/build_files/build_environment/cmake/check_software.cmake b/build_files/build_environment/cmake/check_software.cmake
index 09883221091..50b98ac447c 100644
--- a/build_files/build_environment/cmake/check_software.cmake
+++ b/build_files/build_environment/cmake/check_software.cmake
@@ -42,7 +42,13 @@ if(UNIX)
endforeach()
if(APPLE)
- if(NOT EXISTS "/usr/local/opt/bison/bin/bison")
+ # Homebrew has different default locations for ARM and Intel macOS.
+ if("${CMAKE_HOST_SYSTEM_PROCESSOR}" STREQUAL "arm64")
+ set(HOMEBREW_LOCATION "/opt/homebrew")
+ else()
+ set(HOMEBREW_LOCATION "/usr/local")
+ endif()
+ if(NOT EXISTS "${HOMEBREW_LOCATION}/opt/bison/bin/bison")
string(APPEND _software_missing " bison")
endif()
endif()
diff --git a/build_files/build_environment/cmake/ispc.cmake b/build_files/build_environment/cmake/ispc.cmake
index 967be9ec2f8..56c3cecae17 100644
--- a/build_files/build_environment/cmake/ispc.cmake
+++ b/build_files/build_environment/cmake/ispc.cmake
@@ -25,8 +25,13 @@ if(WIN32)
elseif(APPLE)
# Use bison installed via Homebrew.
# The one which comes which Xcode toolset is too old.
+ if("${CMAKE_HOST_SYSTEM_PROCESSOR}" STREQUAL "arm64")
+ set(HOMEBREW_LOCATION "/opt/homebrew")
+ else()
+ set(HOMEBREW_LOCATION "/usr/local")
+ endif()
set(ISPC_EXTRA_ARGS_APPLE
- -DBISON_EXECUTABLE=/usr/local/opt/bison/bin/bison
+ -DBISON_EXECUTABLE=${HOMEBREW_LOCATION}/opt/bison/bin/bison
)
elseif(UNIX)
set(ISPC_EXTRA_ARGS_UNIX