diff options
| -rw-r--r-- | xmake/core/project/target.lua | 4 | ||||
| -rw-r--r-- | xmake/core/sandbox/modules/import/lib/detect/find_library.lua | 6 |
2 files changed, 5 insertions, 5 deletions
diff --git a/xmake/core/project/target.lua b/xmake/core/project/target.lua index 1f0cf5232..c0a643434 100644 --- a/xmake/core/project/target.lua +++ b/xmake/core/project/target.lua @@ -1901,8 +1901,8 @@ function target.linkname(filename) if count == 0 then linkname, count = filename:gsub(target.filename("__pattern__", "shared"):gsub("%.", "%%."):gsub("__pattern__", "(.+)") .. "$", "%1") end - if count == 0 and config.is_plat("mingw") then - -- for the mingw platform, it is compatible with the libxxx.a and xxx.lib + if count == 0 then + -- for the mingw/cross platform, it is compatible with the libxxx.a and xxx.lib local formats = {static = "lib$(name).a", shared = "lib$(name).so"} linkname, count = filename:gsub(target.filename("__pattern__", "static", {format = formats["static"]}):gsub("%.", "%%."):gsub("__pattern__", "(.+)") .. "$", "%1") if count == 0 then diff --git a/xmake/core/sandbox/modules/import/lib/detect/find_library.lua b/xmake/core/sandbox/modules/import/lib/detect/find_library.lua index bad638548..bfb2315a5 100644 --- a/xmake/core/sandbox/modules/import/lib/detect/find_library.lua +++ b/xmake/core/sandbox/modules/import/lib/detect/find_library.lua @@ -58,14 +58,14 @@ function sandbox_lib_detect_find_library.main(names, paths, opt) opt = opt or {} -- init kinds - kinds = opt.kind or {"static", "shared"} + local kinds = opt.kind or {"static", "shared"} -- find library file from the given paths for _, name in ipairs(table.wrap(names)) do for _, kind in ipairs(table.wrap(kinds)) do local filepath = find_file(target.filename(name, kind), paths, opt) - if not filepath and config.is_plat("mingw") then - -- for the mingw platform, it is compatible with the libxxx.a and xxx.lib + if not filepath then + -- for the mingw/cross platform, it is compatible with the libxxx.a and xxx.lib local formats = {static = "lib$(name).a", shared = "lib$(name).so"} filepath = find_file(target.filename(name, kind, {format = formats[kind]}), paths, opt) end |
