From 2871a4322bc0c5916a48edccb9248cf65ae73c32 Mon Sep 17 00:00:00 2001 From: ruki Date: Wed, 24 May 2023 23:34:39 +0800 Subject: improve module output path #3746 --- xmake/rules/c++/modules/modules_support/common.lua | 20 +++++--------------- 1 file changed, 5 insertions(+), 15 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 a2e06ff69..65267bcbd 100644 --- a/xmake/rules/c++/modules/modules_support/common.lua +++ b/xmake/rules/c++/modules/modules_support/common.lua @@ -728,20 +728,10 @@ end function get_outputdir(target, module) local cachedir = modules_cachedir(target) - local modulepath = module.path or module - local cached = localcache():get2("modules_paths", modulepath) - if cached then - if not os.exists(cached) then - os.mkdir(cached) - end - return cached - else - local modulehash = get_modulehash(target, modulepath) - local moduledir = path.join(cachedir, modulehash) - localcache():set2("modules_paths", modulepath, moduledir) - if not os.exists(moduledir) then - os.mkdir(moduledir) - end - return moduledir + local modulehash = get_modulehash(target, module.path or module) + local outputdir = path.join(cachedir, modulehash) + if not os.exists(outputdir) then + os.mkdir(outputdir) end + return outputdir end -- cgit v1.3.1