summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJérôme Leclercq <[email protected]>2023-03-03 16:21:59 +0100
committerGitHub <[email protected]>2023-03-03 16:21:59 +0100
commita5f69f3a6a915471561d9b2382ad5fefe893cac9 (patch)
tree98fbf3c82d9c56254b30a23a5239656eda3d5e24
parent9f5e98c4cc256d3321d4d5e23037304e723cdb93 (diff)
Fix rust library name (#3452)
Note, this only works for most Rust crates, but some (such as obj-rs) rename their library file.
-rw-r--r--xmake/modules/package/manager/cargo/find_package.lua2
1 files changed, 1 insertions, 1 deletions
diff --git a/xmake/modules/package/manager/cargo/find_package.lua b/xmake/modules/package/manager/cargo/find_package.lua
index d53268333..577fbf253 100644
--- a/xmake/modules/package/manager/cargo/find_package.lua
+++ b/xmake/modules/package/manager/cargo/find_package.lua
@@ -33,7 +33,7 @@ import("lib.detect.find_file")
-- sdl2 -> libsdl2
-- obj-rs -> libobj
function _get_libname(name)
- return "lib" .. name:split("%-")[1]
+ return "lib" .. name:gsub("-", "_")
end
-- get the name set of libraries