diff options
| author | ruki <[email protected]> | 2023-01-06 06:42:13 +0800 |
|---|---|---|
| committer | GitHub <[email protected]> | 2023-01-06 06:42:13 +0800 |
| commit | e8bb34d2e8f1c567a6a6bb70b060a67ccb232e3d (patch) | |
| tree | b495746bd6a3712e7d1ee69e0992dfc79715fd3f /xmake/rules/c++/modules/modules_support/common.lua | |
| parent | 93935417a2c56c3ddc9ea715939441fe41f792f2 (diff) | |
| parent | 856c30d0eae191901395896ba3f33c08b150cdc8 (diff) | |
Merge pull request #3246 from xmake-io/modules
improve module cachedir
Diffstat (limited to 'xmake/rules/c++/modules/modules_support/common.lua')
| -rw-r--r-- | xmake/rules/c++/modules/modules_support/common.lua | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/xmake/rules/c++/modules/modules_support/common.lua b/xmake/rules/c++/modules/modules_support/common.lua index 01fa1bc88..1c3b2f0b1 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) +function modules_cachedir(target, opt) + opt = opt or {} local cachedir = path.join(target:autogendir(), "rules", "modules", "cache") - if not os.isdir(cachedir) then + if opt.mkdir and not os.isdir(cachedir) then os.mkdir(cachedir) end return cachedir |
