Skip to content

Commit

Permalink
CMake (macOS): force dlopen searching for /usr/local/lib
Browse files Browse the repository at this point in the history
  • Loading branch information
CarterLi committed Feb 26, 2024
1 parent 609caad commit 743eeba
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -724,8 +724,8 @@ if(yyjson_FOUND)
else()
# Used for dlopen finding dylibs installed by homebrew
# `/opt/homebrew/lib` is not on in dlopen search path by default
if(APPLE AND DEFINED ENV{HOMEBREW_PREFIX})
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-rpath,$ENV{HOMEBREW_PREFIX}/lib")
if(APPLE)
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-rpath,/opt/homebrew/lib -Wl,-rpath,/usr/local/lib")
endif()
endif()

Expand Down

0 comments on commit 743eeba

Please sign in to comment.