summaryrefslogtreecommitdiff
path: root/xmake/rules/c++/modules/modules_support/common.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2023-01-06 00:45:30 +0800
committerruki <[email protected]>2023-01-06 00:45:30 +0800
commit522000aba4e4d157da5cbbd1b661e3ff0157514e (patch)
tree8ebd7d52bbfabf83f1be3f38aa7ef37e6b8eccd1 /xmake/rules/c++/modules/modules_support/common.lua
parent93935417a2c56c3ddc9ea715939441fe41f792f2 (diff)
improve module cachedir
Diffstat (limited to 'xmake/rules/c++/modules/modules_support/common.lua')
-rw-r--r--xmake/rules/c++/modules/modules_support/common.lua12
1 files changed, 7 insertions, 5 deletions
diff --git a/xmake/rules/c++/modules/modules_support/common.lua b/xmake/rules/c++/modules/modules_support/common.lua
index 01fa1bc88..7e9cad01a 100644
--- a/xmake/rules/c++/modules/modules_support/common.lua
+++ b/xmake/rules/c++/modules/modules_support/common.lua
@@ -41,9 +41,10 @@ function localcache()
end
-- get stl modules cache directory
-function stlmodules_cachedir(target)
+function stlmodules_cachedir(target, opt)
+ opt = opt or {}
local stlcachedir = path.join(config.buildir(), "stlmodules", "cache")
- if not os.isdir(stlcachedir) then
+ if opt.mkdir and not os.isdir(stlcachedir) then
os.mkdir(stlcachedir)
os.mkdir(path.join(stlcachedir, "experimental"))
end
@@ -51,9 +52,10 @@ function stlmodules_cachedir(target)
end
-- get modules cache directory
-function modules_cachedir(target)
- local cachedir = path.join(target:autogendir(), "rules", "modules", "cache")
- if not os.isdir(cachedir) then
+function modules_cachedir(target, opt)
+ opt = opt or {}
+ return path.join(target:autogendir(), "rules", "modules", "cache")
+ if opt.mkdir and not os.isdir(cachedir) then
os.mkdir(cachedir)
end
return cachedir