summaryrefslogtreecommitdiff
path: root/xmake/rules/c++/modules/modules_support/common.lua
diff options
context:
space:
mode:
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