diff options
| -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 |
