From a143cb216f1c3d39c473f2f60954df8996ae7c23 Mon Sep 17 00:00:00 2001 From: Arthur LAURENT Date: Wed, 16 Aug 2023 07:41:20 +0200 Subject: fix clang C++20 modules generate dependencies --- xmake/rules/c++/modules/modules_support/clang.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xmake/rules/c++/modules/modules_support/clang.lua b/xmake/rules/c++/modules/modules_support/clang.lua index c3f40d542..9f7e2225d 100644 --- a/xmake/rules/c++/modules/modules_support/clang.lua +++ b/xmake/rules/c++/modules/modules_support/clang.lua @@ -328,6 +328,7 @@ end -- generate dependency files function generate_dependencies(target, sourcebatch, opt) + local compinst = target:compiler("cxx") local changed = false for _, sourcefile in ipairs(sourcebatch.sourcefiles) do local dependfile = target:dependfile(sourcefile) @@ -358,7 +359,6 @@ function generate_dependencies(target, sourcebatch, opt) io.writefile(jsonfile, outdata) else common.fallback_generate_dependencies(target, jsonfile, sourcefile, function(file) - local compinst = target:compiler("cxx") local compflags = compinst:compflags({sourcefile = file, target = target}) -- exclude -fmodule* and -std=c++/gnu++* flags because, -- when they are set clang try to find bmi of imported modules but they don't exists a this point of compilation -- cgit v1.3.1