From d56a7f9a3b41ac4e8d696dcde3eac1f93159444e Mon Sep 17 00:00:00 2001 From: ruki Date: Sat, 12 Aug 2023 21:26:27 +0800 Subject: improve bmi path for clang #4063 --- xmake/rules/c++/modules/modules_support/clang.lua | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'xmake/rules/c++/modules/modules_support') diff --git a/xmake/rules/c++/modules/modules_support/clang.lua b/xmake/rules/c++/modules/modules_support/clang.lua index d43d8d401..b8b6e57ef 100644 --- a/xmake/rules/c++/modules/modules_support/clang.lua +++ b/xmake/rules/c++/modules/modules_support/clang.lua @@ -32,6 +32,15 @@ import("private.action.build.object", {alias = "objectbuilder"}) import("common") import("stl_headers") +-- get bmi path +-- @see https://github.com/xmake-io/xmake/issues/4063 +function _get_bmi_path(bmifile) + if is_host("windows") then + bmifile = bmifile:gsub(":", "_") + end + return bmifile +end + -- get clang path function _get_clang_path(target) local clang_path = _g.clang_path @@ -68,6 +77,7 @@ end -- get clang-scan-deps function _get_clang_scan_deps(target) + --[[ local clang_scan_deps = _g.clang_scan_deps if not clang_scan_deps then local program, toolname = target:tool("cxx") @@ -87,7 +97,7 @@ function _get_clang_scan_deps(target) clang_scan_deps = clang_scan_deps or false _g.clang_scan_deps = clang_scan_deps end - return clang_scan_deps or nil + return clang_scan_deps or nil]] end -- add a module or an header unit into the mapper @@ -260,7 +270,7 @@ function _build_modulefile(target, sourcefile, opt) local compileflags = {} local bmiflags if opt.provide then - bmifile = opt.provide.bmifile + bmifile = _get_bmi_path(opt.provide.bmifile) if moduleoutputflag then compileflags = table.join("-x", "c++-module", moduleoutputflag .. bmifile, requiresflags) else @@ -622,7 +632,7 @@ function build_modules_for_batchjobs(target, batchjobs, objectfiles, modules, op end if provide or common.has_module_extension(cppfile) then - local bmifile = provide and provide.bmi + local bmifile = _get_bmi_path(provide and provide.bmi) if not common.memcache():get2(name or cppfile, "compiling") then if name and module.external then common.memcache():set2(name or cppfile, "compiling", true) -- cgit v1.3.1 From aead298bad21a17ecadb06c96c51427092e4b600 Mon Sep 17 00:00:00 2001 From: ruki Date: Sat, 12 Aug 2023 22:17:19 +0800 Subject: revert comment --- xmake/rules/c++/modules/modules_support/clang.lua | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'xmake/rules/c++/modules/modules_support') diff --git a/xmake/rules/c++/modules/modules_support/clang.lua b/xmake/rules/c++/modules/modules_support/clang.lua index b8b6e57ef..c3f40d542 100644 --- a/xmake/rules/c++/modules/modules_support/clang.lua +++ b/xmake/rules/c++/modules/modules_support/clang.lua @@ -77,7 +77,6 @@ end -- get clang-scan-deps function _get_clang_scan_deps(target) - --[[ local clang_scan_deps = _g.clang_scan_deps if not clang_scan_deps then local program, toolname = target:tool("cxx") @@ -97,7 +96,7 @@ function _get_clang_scan_deps(target) clang_scan_deps = clang_scan_deps or false _g.clang_scan_deps = clang_scan_deps end - return clang_scan_deps or nil]] + return clang_scan_deps or nil end -- add a module or an header unit into the mapper -- cgit v1.3.1