summaryrefslogtreecommitdiff
path: root/xmake/rules/c++/modules/modules_support
diff options
context:
space:
mode:
authorArthur LAURENT <[email protected]>2024-10-04 18:29:13 +0200
committerArthur LAURENT <[email protected]>2024-10-08 13:47:45 +0200
commit19cc438bceb4ca3bde0fb8dd2820194a28975457 (patch)
tree16e0b6b52faa55738ee2cf75e339bd09748e76fc /xmake/rules/c++/modules/modules_support
parentb63a48f1647126589547c9b9e5ea15e821b9094c (diff)
fix dependency scanner for gcc and clang
Diffstat (limited to 'xmake/rules/c++/modules/modules_support')
-rw-r--r--xmake/rules/c++/modules/modules_support/clang/dependency_scanner.lua2
-rw-r--r--xmake/rules/c++/modules/modules_support/gcc/dependency_scanner.lua2
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"))