summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--xmake/actions/config/main.lua7
1 files changed, 4 insertions, 3 deletions
diff --git a/xmake/actions/config/main.lua b/xmake/actions/config/main.lua
index 8cc16b426..57d2e5043 100644
--- a/xmake/actions/config/main.lua
+++ b/xmake/actions/config/main.lua
@@ -265,15 +265,16 @@ function main()
config.set("buildir", path.relative(buildir, project.directory()), {readonly = true, force = true})
end
- -- check target
- _check_target(targetname)
-
-- install and update requires and config header
local require_enable = option.boolean(option.get("require"))
if (recheck or require_enable) and require_enable ~= false then
install_requires()
end
+ -- check target, @note we must load targets after installing required packages,
+ -- otherwise has_package() will be invalid.
+ _check_target(targetname)
+
-- update the config header
if recheck then
generate_configheader()