From 522000aba4e4d157da5cbbd1b661e3ff0157514e Mon Sep 17 00:00:00 2001 From: ruki Date: Fri, 6 Jan 2023 00:45:30 +0800 Subject: improve module cachedir --- xmake/rules/c++/modules/modules_support/common.lua | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'xmake/rules/c++/modules/modules_support/common.lua') 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 -- cgit v1.3.1