diff --git a/examples/models/llama/CMakeLists.txt b/examples/models/llama/CMakeLists.txt index 46046161dd0..f59252c0df2 100644 --- a/examples/models/llama/CMakeLists.txt +++ b/examples/models/llama/CMakeLists.txt @@ -219,6 +219,8 @@ endif() target_include_directories(llama_main PUBLIC ${_common_include_directories}) target_link_libraries(llama_main PUBLIC llama_runner ${link_libraries}) target_compile_options(llama_main PUBLIC ${_common_compile_options}) -if(NOT APPLE) +if(APPLE) + target_link_options(llama_main PRIVATE -Wl,-rpath,@executable_path) +elseif(UNIX) set_target_properties(llama_main PROPERTIES LINK_FLAGS "-Wl,-rpath='$ORIGIN'") endif()