From 19cc438bceb4ca3bde0fb8dd2820194a28975457 Mon Sep 17 00:00:00 2001 From: Arthur LAURENT Date: Fri, 4 Oct 2024 18:29:13 +0200 Subject: fix dependency scanner for gcc and clang --- xmake/rules/c++/modules/modules_support/clang/dependency_scanner.lua | 2 +- xmake/rules/c++/modules/modules_support/gcc/dependency_scanner.lua | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/xmake/rules/c++/modules/modules_support/clang/dependency_scanner.lua b/xmake/rules/c++/modules/modules_support/clang/dependency_scanner.lua index 5a89d54bb..5b6d50b1c 100644 --- a/xmake/rules/c++/modules/modules_support/clang/dependency_scanner.lua +++ b/xmake/rules/c++/modules/modules_support/clang/dependency_scanner.lua @@ -71,7 +71,7 @@ function generate_dependency_for(target, sourcefile, opt) end fallback_generate_dependencies(target, jsonfile, sourcefile, function(file) local keepsystemincludesflag = compiler_support.get_keepsystemincludesflag(target) - local compflags = flags + local compflags = table.clone(flags) -- 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 in this point of compilation table.remove_if(compflags, function(_, flag) diff --git a/xmake/rules/c++/modules/modules_support/gcc/dependency_scanner.lua b/xmake/rules/c++/modules/modules_support/gcc/dependency_scanner.lua index 2132f4edf..a2f4f8c7b 100644 --- a/xmake/rules/c++/modules/modules_support/gcc/dependency_scanner.lua +++ b/xmake/rules/c++/modules/modules_support/gcc/dependency_scanner.lua @@ -64,7 +64,7 @@ function generate_dependency_for(target, sourcefile, opt) wprint("GCC doesn't support module scanning ! using fallback scanner") end fallback_generate_dependencies(target, jsonfile, sourcefile, function(file) - local compflags = flags + local compflags = table.clone(flags) -- exclude -fmodule* flags because, when they are set gcc try to find bmi of imported modules but they don't exists a this point of compilation table.remove_if(compflags, function(_, flag) return flag:startswith("-fmodule") end) local ifile = path.translate(path.join(outputdir, path.filename(file) .. ".i")) -- cgit v1.3.1