summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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()