summaryrefslogtreecommitdiff
path: root/xmake/modules/private/action/require/impl/package.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2024-08-14 23:56:04 +0800
committerruki <[email protected]>2024-08-23 08:14:32 +0800
commit5f0fcf15d5679348e2e8fd42ccd2de88e4a939ed (patch)
treefa03caa13e12a6ce4210bfbc2b50bb459e709b9f /xmake/modules/private/action/require/impl/package.lua
parentc4202692a4758c4b225f285544ee0e7145e32c13 (diff)
check platform packages
Diffstat (limited to 'xmake/modules/private/action/require/impl/package.lua')
-rw-r--r--xmake/modules/private/action/require/impl/package.lua14
1 files changed, 14 insertions, 0 deletions
diff --git a/xmake/modules/private/action/require/impl/package.lua b/xmake/modules/private/action/require/impl/package.lua
index 1c7eaf9e5..510d9a23f 100644
--- a/xmake/modules/private/action/require/impl/package.lua
+++ b/xmake/modules/private/action/require/impl/package.lua
@@ -852,6 +852,17 @@ function _select_package_runtimes(package)
end
end
+-- check platform toolchains, package maybe use host platform, it's toolchain has been not checked yet.
+-- @see https://github.com/xmake-io/xmake/issues/5455
+function _check_package_platform_toolchains(package)
+ if not package:toolchains() then
+ local platform_inst = platform.load(package:plat(), package:arch())
+ if not platform_inst:check() then
+ raise("no any matched platform for this package(%s)!", package:name())
+ end
+ end
+end
+
-- load required packages
function _load_package(packagename, requireinfo, opt)
@@ -1004,6 +1015,9 @@ function _load_package(packagename, requireinfo, opt)
end
end
+ -- check package platform toolchains first, package:has_tool will be called in on_load
+ _check_package_platform_toolchains(package)
+
-- do load
package:_load()