Skip to content

Commit

Permalink
improve module output path #3746
Browse files Browse the repository at this point in the history
  • Loading branch information
waruqi committed May 24, 2023
1 parent f777cbc commit 2871a43
Showing 1 changed file with 5 additions and 15 deletions.
20 changes: 5 additions & 15 deletions xmake/rules/c++/modules/modules_support/common.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 2871a43

Please sign in to comment.