Skip to content

Commit ec0d1f1

Browse files
committed
Fix -rpath linker option for Apple build
1 parent 176800e commit ec0d1f1

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

examples/models/llama/CMakeLists.txt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,4 +219,8 @@ endif()
219219
target_include_directories(llama_main PUBLIC ${_common_include_directories})
220220
target_link_libraries(llama_main PUBLIC llama_runner ${link_libraries})
221221
target_compile_options(llama_main PUBLIC ${_common_compile_options})
222-
set_target_properties(llama_main PROPERTIES LINK_FLAGS "-Wl,-rpath='$ORIGIN'")
222+
if(APPLE)
223+
target_link_options(llama_main PRIVATE -Wl,-rpath,@executable_path)
224+
elseif(UNIX)
225+
set_target_properties(llama_main PROPERTIES LINK_FLAGS "-Wl,-rpath='$ORIGIN'")
226+
endif()

0 commit comments

Comments
 (0)