diff options
| author | ruki <[email protected]> | 2023-08-12 21:26:27 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2023-08-12 21:26:27 +0800 |
| commit | d56a7f9a3b41ac4e8d696dcde3eac1f93159444e (patch) | |
| tree | 966e5287fed58a39498255cff9c94121383700da /xmake/rules/c++/modules/modules_support/clang.lua | |
| parent | bde76aa37a2b3e7f41b41b81c08739d19cc836df (diff) | |
improve bmi path for clang #4063
Diffstat (limited to 'xmake/rules/c++/modules/modules_support/clang.lua')
| -rw-r--r-- | xmake/rules/c++/modules/modules_support/clang.lua | 16 |
1 files changed, 13 insertions, 3 deletions
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) |
