Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,17 @@ if(APPLE)
execute_process(COMMAND brew --prefix OUTPUT_VARIABLE HOMEBREW_PREFIX OUTPUT_STRIP_TRAILING_WHITESPACE)
if(HOMEBREW_PREFIX)
link_directories("${HOMEBREW_PREFIX}/lib")
include_directories("${HOMEBREW_PREFIX}/include")
# SYSTEM is load-bearing, not cosmetic. A plain include_directories()
# here is directory-scoped at the TOP level, so it is inherited by every
# add_subdirectory() and initialises every target's INCLUDE_DIRECTORIES
# ahead of whatever that target adds for itself -- which means
# /opt/homebrew/include outranks every vendored include dir in the tree.
# Any Homebrew formula whose headers share a basename with a vendored one
# then silently wins, reversing the choice USE_SYSTEM_* made in CMake:
# ggml.h, whisper.h and fftw3.h are all shadowed on a stock dev machine.
Comment thread
jensenpat marked this conversation as resolved.
Outdated
# SYSTEM emits -isystem, which the compiler searches AFTER all -I paths,
# so Homebrew stays findable and stops taking precedence.
include_directories(SYSTEM "${HOMEBREW_PREFIX}/include")
endif()
endif()

Expand Down
Loading