Skip to content

Commit 29025d0

Browse files
authored
Fix -rpath linker option for Apple build (#13850)
Fix for #12333 which broke mac runner tests on trunk, since `$ORIGIN` is linux only.
1 parent c3f8d64 commit 29025d0

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

examples/models/llama/CMakeLists.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,6 +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-
if(NOT APPLE)
222+
if(APPLE)
223+
target_link_options(llama_main PRIVATE -Wl,-rpath,@executable_path)
224+
elseif(UNIX)
223225
set_target_properties(llama_main PROPERTIES LINK_FLAGS "-Wl,-rpath='$ORIGIN'")
224226
endif()

0 commit comments

Comments
 (0)