Skip to content

Commit

Permalink
fix link order
Browse files Browse the repository at this point in the history
  • Loading branch information
star-hengxing committed Sep 17, 2024
1 parent 7631f57 commit 4121ab2
Showing 1 changed file with 13 additions and 11 deletions.
24 changes: 13 additions & 11 deletions packages/l/llama.cpp/xmake.lua
Original file line number Diff line number Diff line change
Expand Up @@ -19,23 +19,25 @@ package("llama.cpp")
add_syslinks("pthread")
end

add_links("llama", "ggml")

add_deps("cmake")

on_component("llama", function (package, component)
component:add("links", "llama")
if package:config("shared") then
package:add("defines", "LLAMA_SHARED")
end
end)
if on_check then
on_check("android", function (package)
local ndk = package:toolchain("ndk")
local ndkver = ndk:config("ndkver")
local ndk_sdkver = ndk:config("ndk_sdkver")
assert(ndkver and tonumber(ndkver) > 22, "package(llama.cpp) require ndkver > 22")
assert(ndk_sdkver and tonumber(ndk_sdkver) >= 24, "package(llama.cpp) require ndk api >= 24")
end)
end

on_component("ggml", function (package, component)
component:add("links", "ggml")
on_load(function (package)
if package:config("shared") then
package:add("defines", "GGML_SHARED")
package:add("defines", "GGML_SHARED", "LLAMA_SHARED")
end
end)

on_load(function (package)
if package:config("openmp") then
package:add("deps", "openmp")
end
Expand Down

0 comments on commit 4121ab2

Please sign in to comment.