summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2017-07-17 23:57:21 +0800
committerruki <[email protected]>2017-07-17 23:57:21 +0800
commitd0cead611d9f97a678d7c80a9354aee47a89e218 (patch)
tree7efb0ad9184d3a9bcde80d87070793a40d57c814
parent2a8458eb016b682f815a26b90ab65abd9e67b37a (diff)
fix core.project.global to base
-rw-r--r--xmake/platforms/android/check.lua2
-rw-r--r--xmake/platforms/checker.lua13
-rw-r--r--xmake/platforms/iphoneos/check.lua2
-rw-r--r--xmake/platforms/linux/check.lua2
-rw-r--r--xmake/platforms/macosx/check.lua2
-rw-r--r--xmake/platforms/mingw/check.lua2
-rw-r--r--xmake/platforms/watchos/check.lua2
-rw-r--r--xmake/platforms/windows/check.lua5
8 files changed, 18 insertions, 12 deletions
diff --git a/xmake/platforms/android/check.lua b/xmake/platforms/android/check.lua
index 4d70c5001..0127e62c0 100644
--- a/xmake/platforms/android/check.lua
+++ b/xmake/platforms/android/check.lua
@@ -144,7 +144,7 @@ function main(kind, toolkind)
-- only check the given tool?
if toolkind then
- return checker.toolchain_check(import("core.project." .. kind), toolkind, _toolchains)
+ return checker.toolchain_check(kind, toolkind, _toolchains)
end
-- init the check list of config
diff --git a/xmake/platforms/checker.lua b/xmake/platforms/checker.lua
index 627d257f7..dd9da849d 100644
--- a/xmake/platforms/checker.lua
+++ b/xmake/platforms/checker.lua
@@ -74,8 +74,11 @@ end
-- check all for the given config kind
function check(kind, checkers)
+ -- init config name
+ local confignames = {config = "core.project.config", global = "core.base.global"}
+
-- import config module
- local config = import("core.project." .. kind)
+ local config = import(confignames[kind])
-- check all
for _, checker in ipairs(checkers[kind]) do
@@ -181,7 +184,13 @@ function toolchain_insert(toolchains, toolkind, cross, name, description, check)
end
-- check the toolchain
-function toolchain_check(config, toolkind, toolchains)
+function toolchain_check(kind, toolkind, toolchains)
+
+ -- init config name
+ local confignames = {config = "core.project.config", global = "core.base.global"}
+
+ -- import config module
+ local config = import(confignames[kind])
-- load toolchains if be function
if type(toolchains) == "function" then
diff --git a/xmake/platforms/iphoneos/check.lua b/xmake/platforms/iphoneos/check.lua
index a12a53801..b247db5e6 100644
--- a/xmake/platforms/iphoneos/check.lua
+++ b/xmake/platforms/iphoneos/check.lua
@@ -83,7 +83,7 @@ function main(kind, toolkind)
-- only check the given tool?
if toolkind then
- return checker.toolchain_check(import("core.project." .. kind), toolkind, _toolchains)
+ return checker.toolchain_check(kind, toolkind, _toolchains)
end
-- init the check list of config
diff --git a/xmake/platforms/linux/check.lua b/xmake/platforms/linux/check.lua
index c3751b644..39d8daf70 100644
--- a/xmake/platforms/linux/check.lua
+++ b/xmake/platforms/linux/check.lua
@@ -157,7 +157,7 @@ function main(kind, toolkind)
-- only check the given tool?
if toolkind then
- return checker.toolchain_check(import("core.project." .. kind), toolkind, _toolchains)
+ return checker.toolchain_check(kind, toolkind, _toolchains)
end
-- init the check list of config
diff --git a/xmake/platforms/macosx/check.lua b/xmake/platforms/macosx/check.lua
index 833087684..e04d44103 100644
--- a/xmake/platforms/macosx/check.lua
+++ b/xmake/platforms/macosx/check.lua
@@ -123,7 +123,7 @@ function main(kind, toolkind)
-- only check the given tool?
if toolkind then
- return checker.toolchain_check(import("core.project." .. kind), toolkind, _toolchains)
+ return checker.toolchain_check(kind, toolkind, _toolchains)
end
-- init the check list of config
diff --git a/xmake/platforms/mingw/check.lua b/xmake/platforms/mingw/check.lua
index f3f8872db..080e513ce 100644
--- a/xmake/platforms/mingw/check.lua
+++ b/xmake/platforms/mingw/check.lua
@@ -76,7 +76,7 @@ function main(kind, toolkind)
-- only check the given tool?
if toolkind then
- return checker.toolchain_check(import("core.project." .. kind), toolkind, _toolchains)
+ return checker.toolchain_check(kind, toolkind, _toolchains)
end
-- init the check list of config
diff --git a/xmake/platforms/watchos/check.lua b/xmake/platforms/watchos/check.lua
index 60a923fa8..eec2efd30 100644
--- a/xmake/platforms/watchos/check.lua
+++ b/xmake/platforms/watchos/check.lua
@@ -83,7 +83,7 @@ function main(kind, toolkind)
-- only check the given tool?
if toolkind then
- return checker.toolchain_check(import("core.project." .. kind), toolkind, _toolchains)
+ return checker.toolchain_check(kind, toolkind, _toolchains)
end
-- init the check list of config
diff --git a/xmake/platforms/windows/check.lua b/xmake/platforms/windows/check.lua
index 7bcb96326..b1f2881e6 100644
--- a/xmake/platforms/windows/check.lua
+++ b/xmake/platforms/windows/check.lua
@@ -179,14 +179,11 @@ function main(kind, toolkind)
-- only check the given tool?
if toolkind then
- -- import the given config
- local config = import("core.project." .. kind)
-
-- enter environment
environment.enter("toolchains")
-- check it
- checker.toolchain_check(config, toolkind, _toolchains)
+ checker.toolchain_check(kind, toolkind, _toolchains)
-- leave environment
environment.leave("toolchains")