summaryrefslogtreecommitdiff
path: root/xmake/core/project/config.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2020-02-19 23:22:45 +0800
committerruki <[email protected]>2020-02-19 14:16:31 +0800
commit656314dce0e87308babf2f49a35793a3167e849b (patch)
tree231bdde613bd6e1374607dcd42c281e9f60d3abf /xmake/core/project/config.lua
parent9201a7b6b9f0b25312130f8eeae73d546532c013 (diff)
improve reconfigure for trybuild
Diffstat (limited to 'xmake/core/project/config.lua')
-rw-r--r--xmake/core/project/config.lua16
1 files changed, 8 insertions, 8 deletions
diff --git a/xmake/core/project/config.lua b/xmake/core/project/config.lua
index bb92081b3..a7e474338 100644
--- a/xmake/core/project/config.lua
+++ b/xmake/core/project/config.lua
@@ -29,11 +29,6 @@ local table = require("base/table")
local utils = require("base/utils")
local option = require("base/option")
--- get the configure file
-function config._file()
- return path.join(config.directory(), "xmake.conf")
-end
-
-- load the project configure
function config._load(targetname)
@@ -41,7 +36,7 @@ function config._load(targetname)
targetname = targetname or "all"
-- load configure from the file first
- local filepath = config._file()
+ local filepath = config.filepath()
if os.isfile(filepath) then
-- load it
@@ -145,6 +140,11 @@ function config.buildir()
return buildir
end
+-- get the configure file
+function config.filepath()
+ return path.join(config.directory(), "xmake.conf")
+end
+
-- get the configure directory on the current host/arch platform
function config.directory()
if config._DIRECTORY == nil then
@@ -185,7 +185,7 @@ function config.save(targetname)
-- load the previous results from configure
local results = {}
- local filepath = config._file()
+ local filepath = config.filepath()
if os.isfile(filepath) then
results = io.load(filepath) or {}
end
@@ -207,7 +207,7 @@ function config.save(targetname)
results.__version = xmake._VERSION_SHORT
-- save it
- return io.save(config._file(), results)
+ return io.save(config.filepath(), results)
end
-- read value from the configure file directly