summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2019-11-19 00:46:07 +0800
committerruki <[email protected]>2019-11-18 22:36:46 +0800
commit299862deb370f5b9df641dfa5a4fc7d20923a042 (patch)
treebf6eb30e8c9aff932bb2e0a1524f12f29062aa4c
parentcf984b4a0e9e4ea733f2c35deca3b714baa2a227 (diff)
improve xmakerc file
-rw-r--r--xmake/core/project/project.lua8
-rw-r--r--xmake/core/sandbox/modules/import/core/project/project.lua5
2 files changed, 12 insertions, 1 deletions
diff --git a/xmake/core/project/project.lua b/xmake/core/project/project.lua
index 0a6451b80..300f84278 100644
--- a/xmake/core/project/project.lua
+++ b/xmake/core/project/project.lua
@@ -295,7 +295,13 @@ end
function project.rcfile()
local xmakerc = project._XMAKE_RCFILE
if xmakerc == nil then
- xmakerc = os.getenv("XMAKE_RCFILE") or "~/.xmakerc.lua"
+ xmakerc = "/etc/xmakerc.lua"
+ if not os.isfile(xmakerc) then
+ xmakerc = "~/.xmakerc.lua"
+ if not os.isfile(xmakerc) then
+ xmakerc = path.join(global.directory(), "xmakerc.lua")
+ end
+ end
project._XMAKE_RCFILE = xmakerc
end
return xmakerc
diff --git a/xmake/core/sandbox/modules/import/core/project/project.lua b/xmake/core/sandbox/modules/import/core/project/project.lua
index 7fe206019..83bb9fead 100644
--- a/xmake/core/sandbox/modules/import/core/project/project.lua
+++ b/xmake/core/sandbox/modules/import/core/project/project.lua
@@ -145,6 +145,11 @@ function sandbox_core_project.file()
return project.file()
end
+-- get the project rcfile
+function sandbox_core_project.rcfile()
+ return project.rcfile()
+end
+
-- get the project directory
function sandbox_core_project.directory()
return project.directory()