Skip to content

Commit 5f0fcf1

Browse files
committed
check platform packages
1 parent c420269 commit 5f0fcf1

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

xmake/modules/private/action/require/impl/package.lua

+14
Original file line numberDiff line numberDiff line change
@@ -852,6 +852,17 @@ function _select_package_runtimes(package)
852852
end
853853
end
854854

855+
-- check platform toolchains, package maybe use host platform, it's toolchain has been not checked yet.
856+
-- @see https://github.com/xmake-io/xmake/issues/5455
857+
function _check_package_platform_toolchains(package)
858+
if not package:toolchains() then
859+
local platform_inst = platform.load(package:plat(), package:arch())
860+
if not platform_inst:check() then
861+
raise("no any matched platform for this package(%s)!", package:name())
862+
end
863+
end
864+
end
865+
855866
-- load required packages
856867
function _load_package(packagename, requireinfo, opt)
857868

@@ -1004,6 +1015,9 @@ function _load_package(packagename, requireinfo, opt)
10041015
end
10051016
end
10061017

1018+
-- check package platform toolchains first, package:has_tool will be called in on_load
1019+
_check_package_platform_toolchains(package)
1020+
10071021
-- do load
10081022
package:_load()
10091023

0 commit comments

Comments
 (0)