diff options
| author | ruki <[email protected]> | 2024-04-28 16:19:54 +0800 |
|---|---|---|
| committer | GitHub <[email protected]> | 2024-04-28 16:19:54 +0800 |
| commit | 5f1a07e6f343a67ed53a30d302eea916fc069e91 (patch) | |
| tree | ab70ff240e6e3ae8bdd5c4dffc1cc4ee2a7e7a1a | |
| parent | 61498e2197e74a0d77bfad7472eefcc6ea565e45 (diff) | |
| parent | 66421508282ec5b34dd66916c41a894c2ebd4ccb (diff) | |
Merge pull request #5023 from SHIINASAMA/master
vcpkg dynamic triplet
| -rw-r--r-- | xmake/core/project/target.lua | 8 | ||||
| -rw-r--r-- | xmake/modules/package/manager/vcpkg/configurations.lua | 11 |
2 files changed, 18 insertions, 1 deletions
diff --git a/xmake/core/project/target.lua b/xmake/core/project/target.lua index fb48df6f8..9c396e25c 100644 --- a/xmake/core/project/target.lua +++ b/xmake/core/project/target.lua @@ -2850,7 +2850,13 @@ function target.linkname(filename, opt) if count == 0 and opt.plat == "mingw" then linkname, count = filename:gsub(target.filename("__pattern__", "static", {plat = "windows"}):gsub("%.", "%%."):gsub("__pattern__", "(.+)") .. "$", "%1") end - return count > 0 and linkname or nil + if count > 0 and linkname then + return linkname + end + -- for custom shared libraries name, xxx.so, xxx.dylib + if not filename:startswith("lib") and (filename:endswith(".so") or filename:endswith(".dylib")) then + return filename + end end -- new a target instance diff --git a/xmake/modules/package/manager/vcpkg/configurations.lua b/xmake/modules/package/manager/vcpkg/configurations.lua index df79e1bd2..12bc5f5bd 100644 --- a/xmake/modules/package/manager/vcpkg/configurations.lua +++ b/xmake/modules/package/manager/vcpkg/configurations.lua @@ -56,6 +56,17 @@ function triplet(configs, plat, arch) if configs.runtimes and configs.runtimes:startswith("MD") then triplet = triplet .. "-md" end + elseif plat == "linux" then + -- x64-linux-dynamic + if arch == "x64" and configs.shared then + triplet = triplet .. "-dynamic" + end + elseif plat == "osx" then + -- x64-osx-dynamic + -- arm64-osx-dynamic + if (arch == "x64" or arch == "arm64") and configs.shared then + triplet = triplet .. "-dynamic" + end elseif plat == "mingw" then triplet = triplet .. (configs.shared ~= true and "-static" or "-dynamic") end |
