diff options
| author | ruki <[email protected]> | 2025-08-12 23:00:17 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2025-08-12 12:02:20 +0800 |
| commit | cc8b06a691d69e75dc3c0a605eeccce9c345c556 (patch) | |
| tree | ef7be42a2f3c6d0c024a027993aea2235b786d47 | |
| parent | c39e51cd62cd158827df495eef79276c43cd4dfc (diff) | |
improve rule tips
| -rw-r--r-- | xmake/core/sandbox/modules/import/core/project/project.lua | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/xmake/core/sandbox/modules/import/core/project/project.lua b/xmake/core/sandbox/modules/import/core/project/project.lua index b869cb10a..750787ec4 100644 --- a/xmake/core/sandbox/modules/import/core/project/project.lua +++ b/xmake/core/sandbox/modules/import/core/project/project.lua @@ -151,16 +151,17 @@ function sandbox_core_project._load_package_rules_for_target(target) local packagename = rulename:match("@(.-)/") if packagename then local pkginfo = project.required_package(packagename) + local ruleinst if pkginfo then - local r = pkginfo:rule(rulename) - if r then - target:rule_add(r) - for _, dep in pairs(table.wrap(r:deps())) do + ruleinst = pkginfo:rule(rulename) + if ruleinst then + target:rule_add(ruleinst) + for _, dep in pairs(table.wrap(ruleinst:deps())) do target:rule_add(dep) end end - else - -- @see https://github.com/xmake-io/xmake/issues/6682 + end + if not ruleinst then raise("target(\"%s\"): unknown package rule in add_rules(\"%s\")", target:fullname(), rulename) end end |
