summaryrefslogtreecommitdiff
path: root/xmake/scripts/base/project.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2015-06-25 15:59:53 +0800
committerruki <[email protected]>2015-06-25 15:59:53 +0800
commit8f45b7c5b9e62f3ac2cc8782d4de1bff3ed31008 (patch)
treeb0d60cff07630412756bf5e401c61aff1db6e4b4 /xmake/scripts/base/project.lua
parent8d46305db1819357868d3c71a61d98856aa0fa5a (diff)
load and make configure for package
Diffstat (limited to 'xmake/scripts/base/project.lua')
-rw-r--r--xmake/scripts/base/project.lua29
1 files changed, 21 insertions, 8 deletions
diff --git a/xmake/scripts/base/project.lua b/xmake/scripts/base/project.lua
index 7dc98b5b0..c5052dd19 100644
--- a/xmake/scripts/base/project.lua
+++ b/xmake/scripts/base/project.lua
@@ -431,27 +431,27 @@ function project._makeconf_for_target(target_name, target)
assert(target_name and target)
-- get the target configure file
- local configfile = target.config_h
- if not configfile then
+ local config_h = target.config_h
+ if not config_h then
return true
end
-- translate file path
- if not path.is_absolute(configfile) then
- configfile = path.absolute(configfile, xmake._PROJECT_DIR)
+ if not path.is_absolute(config_h) then
+ config_h = path.absolute(config_h, xmake._PROJECT_DIR)
else
- configfile = path.translate(configfile)
+ config_h = path.translate(config_h)
end
-- the prefix
local prefix = target.config_h_prefix or (target_name:upper() .. "_CONFIG")
-- open the file
- local file = project._CONFILES[configfile] or io.openmk(configfile)
+ local file = project._CONFILES[config_h] or io.openmk(config_h)
assert(file)
-- make the head
- if project._CONFILES[configfile] then file:write("\n") end
+ if project._CONFILES[config_h] then file:write("\n") end
file:write(string.format("#ifndef %s_H\n", prefix))
file:write(string.format("#define %s_H\n", prefix))
file:write("\n")
@@ -520,7 +520,7 @@ function project._makeconf_for_target(target_name, target)
file:write("#endif\n")
-- cache the file
- project._CONFILES[configfile] = file
+ project._CONFILES[config_h] = file
-- ok
return true
@@ -1154,6 +1154,19 @@ function project.load()
project._make_targets(configs)
end
+-- reload the project
+function project.reload()
+
+ -- clear it first
+ project._MTIMES = nil
+ project._TARGETS = nil
+ project._CONFILES = nil
+ project._CURDIR = nil
+
+ -- load it
+ return project.load()
+end
+
-- dump the current configure
function project.dump()