summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2018-11-24 00:41:34 +0800
committerruki <[email protected]>2018-11-23 22:09:27 +0800
commit2130def012a0e6d023bdb3825c85458e353e9841 (patch)
treedb1294813a514c82278547a329bd69aa67e24477
parentb4c0ad8d5b238e228530f147759e1282f1311e74 (diff)
fix load target orders
-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()