diff options
| author | ruki <[email protected]> | 2022-09-06 22:36:10 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2022-09-06 22:36:10 +0800 |
| commit | 1fb9ef1571ded01ffe2077edcee0057bf4ced911 (patch) | |
| tree | 6e212c8de704c9d63b47e5fcff5200f0fb7f55fd /xmake/modules | |
| parent | 10d142571fc619051f83d116393ab86a29fcaee2 (diff) | |
rename linkdeps to librarydeps
Diffstat (limited to 'xmake/modules')
4 files changed, 28 insertions, 28 deletions
diff --git a/xmake/modules/private/action/require/impl/actions/install.lua b/xmake/modules/private/action/require/impl/actions/install.lua index 2a422795f..10412c0a9 100644 --- a/xmake/modules/private/action/require/impl/actions/install.lua +++ b/xmake/modules/private/action/require/impl/actions/install.lua @@ -49,7 +49,7 @@ function _patch_pkgconfig(package) vprint("patching %s ..", pcfile) -- fetch package - local fetchinfo = package:fetch_linkdeps() + local fetchinfo = package:fetch_librarydeps() if not fetchinfo then return end diff --git a/xmake/modules/private/action/require/impl/install_packages.lua b/xmake/modules/private/action/require/impl/install_packages.lua index 1e99cf9b8..3e608f671 100644 --- a/xmake/modules/private/action/require/impl/install_packages.lua +++ b/xmake/modules/private/action/require/impl/install_packages.lua @@ -76,10 +76,10 @@ function _replace_package(packages, instance, extinstance) break end end - local linkdeps = rawinstance._LINKDEPS - for depidx, dep in ipairs(linkdeps) do + local librarydeps = rawinstance._LIBRARYDEPS + for depidx, dep in ipairs(librarydeps) do if dep == instance then - linkdeps[depidx] = extinstance + librarydeps[depidx] = extinstance break end end diff --git a/xmake/modules/private/action/require/impl/package.lua b/xmake/modules/private/action/require/impl/package.lua index a506a66c0..26f608e3d 100644 --- a/xmake/modules/private/action/require/impl/package.lua +++ b/xmake/modules/private/action/require/impl/package.lua @@ -266,7 +266,7 @@ end -- orderdeps: c -> b -> a -- function _sort_packagedeps(package) - -- we must use native deps list instead of package:deps() to generate correct linkdeps + -- we must use native deps list instead of package:deps() to generate correct librarydeps local orderdeps = {} for _, dep in ipairs(package:plaindeps()) do if dep then @@ -277,7 +277,7 @@ function _sort_packagedeps(package) return orderdeps end --- sort link deps +-- sort library deps and generate correct link order -- -- e.g. -- @@ -286,13 +286,13 @@ end -- -- orderdeps: a -> b -> c -- -function _sort_linkdeps(package) - -- we must use native deps list instead of package:deps() to generate correct linkdeps +function _sort_librarydeps(package) + -- we must use native deps list instead of package:deps() to generate correct link order local orderdeps = {} for _, dep in ipairs(package:plaindeps()) do if dep and dep:is_library() and not dep:is_private() then table.insert(orderdeps, dep) - table.join2(orderdeps, _sort_linkdeps(dep)) + table.join2(orderdeps, _sort_librarydeps(dep)) end end return orderdeps @@ -883,7 +883,7 @@ function _load_packages(requires, opt) package._DEPS = packagedeps package._PLAINDEPS = plaindeps package._ORDERDEPS = table.unique(_sort_packagedeps(package)) - package._LINKDEPS = table.reverse_unique(_sort_linkdeps(package)) + package._LIBRARYDEPS = table.reverse_unique(_sort_librarydeps(package)) end end @@ -926,7 +926,7 @@ end -- function _check_package_depconflicts(package) local packagekeys = {} - for _, dep in ipairs(package:linkdeps()) do + for _, dep in ipairs(package:librarydeps()) do local key = _get_packagekey(dep:name(), dep:requireinfo()) local prevkey = packagekeys[dep:name()] if prevkey then @@ -940,15 +940,15 @@ end -- must depend on the given package? function _must_depend_on(package, dep) local manifest = package:manifest_load() - if manifest and manifest.linkdeps then - local linkdeps = hashset.from(manifest.linkdeps) - return linkdeps:has(dep:name()) + if manifest and manifest.librarydeps then + local librarydeps = hashset.from(manifest.librarydeps) + return librarydeps:has(dep:name()) end end -- compatible with all previous link dependencies? -- @see https://github.com/xmake-io/xmake/issues/2719 -function _compatible_with_previous_linkdeps(package, opt) +function _compatible_with_previous_librarydeps(package, opt) -- skip to check compatibility? opt = opt or {} @@ -956,28 +956,28 @@ function _compatible_with_previous_linkdeps(package, opt) return true end - -- check strict compatibility for linkdeps? - local strict_compatibility = project.policy("package.linkdeps.strict_compatibility") + -- check strict compatibility for librarydeps? + local strict_compatibility = project.policy("package.librarydeps.strict_compatibility") if strict_compatibility == nil then - strict_compatibility = package:policy("package.linkdeps.strict_compatibility") + strict_compatibility = package:policy("package.librarydeps.strict_compatibility") end if not strict_compatibility then return true end -- has been checked? - local compatible_checked = package:data("linkdeps.compatible_checked") + local compatible_checked = package:data("librarydeps.compatible_checked") if compatible_checked then return end - -- compute the buildhash for previous linkdeps + -- compute the buildhash for previous librarydeps local depinfos_prev = {} local depnames = hashset.new() local manifest = package:manifest_load() - if manifest and manifest.linkdeps then + if manifest and manifest.librarydeps then local deps = manifest.deps or {} - for _, depname in ipairs(manifest.linkdeps) do + for _, depname in ipairs(manifest.librarydeps) do local depinfo = deps[depname] if depinfo and depinfo.buildhash then depinfos_prev[depname] = depinfo @@ -986,9 +986,9 @@ function _compatible_with_previous_linkdeps(package, opt) end end - -- compute the buildhash for current linkdeps + -- compute the buildhash for current librarydeps local depinfos_curr = {} - for _, dep in ipairs(package:linkdeps()) do + for _, dep in ipairs(package:librarydeps()) do depinfos_curr[dep:name()] = { version = dep:version_str(), buildhash = dep:buildhash() @@ -1016,7 +1016,7 @@ function _compatible_with_previous_linkdeps(package, opt) end end if not is_compatible and #compatible_tips > 0 then - package:data_set("linkdeps.compatible_tips", compatible_tips) + package:data_set("librarydeps.compatible_tips", compatible_tips) end if not is_compatible then package:data_set("force_reinstall", true) @@ -1034,7 +1034,7 @@ function should_install(package, opt) if package:is_template() then return false end - if package:exists() and _compatible_with_previous_linkdeps(package, opt) then + if package:exists() and _compatible_with_previous_librarydeps(package, opt) then return false end -- we need not install it if this package need only be fetched @@ -1103,7 +1103,7 @@ function get_configs_str(package) end end end - local compatible_tips = package:data("linkdeps.compatible_tips") + local compatible_tips = package:data("librarydeps.compatible_tips") if compatible_tips then table.insert(configs, "deps:" .. table.concat(compatible_tips, ",")) end diff --git a/xmake/modules/private/action/require/impl/register_packages.lua b/xmake/modules/private/action/require/impl/register_packages.lua index afc84eb98..ecab45b7c 100644 --- a/xmake/modules/private/action/require/impl/register_packages.lua +++ b/xmake/modules/private/action/require/impl/register_packages.lua @@ -88,7 +88,7 @@ function _register_required_package(instance, required_package) _register_required_package_base(instance, required_package) _register_required_package_libs(instance, required_package) _register_required_package_envs(instance, envs) - for _, dep in ipairs(instance:linkdeps()) do + for _, dep in ipairs(instance:librarydeps()) do if instance:is_library() then _register_required_package_libs(dep, required_package, true) end |
