summaryrefslogtreecommitdiff
path: root/xmake/scripts/platform/platform.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2015-05-19 15:35:49 +0800
committerruki <[email protected]>2015-05-19 15:35:49 +0800
commit75bdd1517bc093774855c23a286e97113896f5f0 (patch)
tree4dd3eded914ea143c39fb05480babc5b603123da /xmake/scripts/platform/platform.lua
parentf9214c5e20b64d662af20b83da5889e6675dea95 (diff)
make object deps for makefile
Diffstat (limited to 'xmake/scripts/platform/platform.lua')
-rw-r--r--xmake/scripts/platform/platform.lua20
1 files changed, 11 insertions, 9 deletions
diff --git a/xmake/scripts/platform/platform.lua b/xmake/scripts/platform/platform.lua
index 47ccb4914..6ee8de802 100644
--- a/xmake/scripts/platform/platform.lua
+++ b/xmake/scripts/platform/platform.lua
@@ -30,26 +30,28 @@ local config = require("base/config")
-- init platform
function platform.init()
- -- have been existed?
- if platform._CONFIGS then
- return platform._CONFIGS
- end
+ -- init platform configs
+ platform._CONFIGS = platform._CONFIGS or {}
+ local configs = platform._CONFIGS
-- get target
local target = config.target()
assert(target)
+ -- init configs
+ configs.plat = target.plat
+ configs.host = target.host
+ configs.arch = target.arch
+ configs.mode = target.mode
+
-- load platform
local p = require("platform/_" .. target.plat)
if not p then
- return nil
+ return false
end
-- init platform
- platform._CONFIGS = p.init()
-
- -- ok?
- return platform._CONFIGS
+ return p.init(configs)
end
-- dump configs