Skip to content

Commit

Permalink
Use "brew --prefix" to detect HomeBrew prefix (#1095)
Browse files Browse the repository at this point in the history
Should hopefully work properly on Intel macs now.
  • Loading branch information
jsberg-bnl authored Jul 30, 2024
1 parent e3e8beb commit 1449297
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
7 changes: 4 additions & 3 deletions util/Master.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -338,9 +338,10 @@ IF (${CMAKE_SYSTEM_NAME} MATCHES "Darwin" AND NOT $ENV{ACC_CONDA_BUILD} MATCHES
endif()
endif()
if (DO_BREW)
# Assuming an ARM mac here, path is different for an x86 Mac
set(ACC_INC_DIRS ${ACC_INC_DIRS} /opt/homebrew/include /opt/homebrew/opt/readline/include)
set(ACC_LIB_DIRS ${ACC_LIB_DIRS} /opt/homebrew/lib /opt/homebrew/opt/readline/lib)
execute_process(COMMAND "brew" "--prefix" OUTPUT_VARIABLE HOMEBREW_PREFIX)
string(STRIP "${HOMEBREW_PREFIX}" HOMEBREW_PREFIX)
set(ACC_INC_DIRS ${ACC_INC_DIRS} "${HOMEBREW_PREFIX}/include" "${HOMEBREW_PREFIX}/opt/readline/include")
set(ACC_LIB_DIRS ${ACC_LIB_DIRS} "${HOMEBREW_PREFIX}/lib" "${HOMEBREW_PREFIX}/opt/readline/lib")
elseif (DO_PORT)
set(ACC_INC_DIRS ${ACC_INC_DIRS} /opt/local/include)
set(ACC_LIB_DIRS ${ACC_LIB_DIRS} /opt/local/lib)
Expand Down
2 changes: 1 addition & 1 deletion util/dist_source_me
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,7 @@ func_macos_gcc () {
fi
elif [ "$brew" ]
then
p=/opt/homebrew/bin/gcc-
p=$(brew --prefix)/bin/gcc-
v=0
for g in $p[0-9]*
do
Expand Down

0 comments on commit 1449297

Please sign in to comment.