summaryrefslogtreecommitdiff
path: root/xmake/rules/c++/modules/modules_support
diff options
context:
space:
mode:
authorruki <[email protected]>2023-01-25 00:34:04 +0800
committerruki <[email protected]>2023-01-25 00:34:04 +0800
commit535529d5e08cf8fc0f2d624508c4ef145bce12c3 (patch)
treec742528dd1db45dad9cb2198c9204a331396d57e /xmake/rules/c++/modules/modules_support
parentb6632b7fca968b1efaa86093d8aa345230dbdf3e (diff)
format code
Diffstat (limited to 'xmake/rules/c++/modules/modules_support')
-rw-r--r--xmake/rules/c++/modules/modules_support/clang.lua4
-rw-r--r--xmake/rules/c++/modules/modules_support/gcc.lua2
2 files changed, 4 insertions, 2 deletions
diff --git a/xmake/rules/c++/modules/modules_support/clang.lua b/xmake/rules/c++/modules/modules_support/clang.lua
index 320061e1a..1078c4176 100644
--- a/xmake/rules/c++/modules/modules_support/clang.lua
+++ b/xmake/rules/c++/modules/modules_support/clang.lua
@@ -272,7 +272,9 @@ function generate_dependencies(target, sourcebatch, opt)
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
- compflags = table.remove_if(compflags, function(_, flag) return flag:startswith("-fmodule") or flag:startswith("-std=c++") or flag:startswith("-std=gnu++") end)
+ table.remove_if(compflags, function(_, flag)
+ return flag:startswith("-fmodule") or flag:startswith("-std=c++") or flag:startswith("-std=gnu++")
+ end)
local ifile = path.translate(path.join(outputdir, path.filename(file) .. ".i"))
os.vrunv(compinst:program(), table.join(compflags, {"-E", "-x", "c++", file, "-o", ifile}))
local content = io.readfile(ifile)
diff --git a/xmake/rules/c++/modules/modules_support/gcc.lua b/xmake/rules/c++/modules/modules_support/gcc.lua
index eb83ed96d..5ebcb1128 100644
--- a/xmake/rules/c++/modules/modules_support/gcc.lua
+++ b/xmake/rules/c++/modules/modules_support/gcc.lua
@@ -201,7 +201,7 @@ function generate_dependencies(target, sourcebatch, opt)
local compinst = target:compiler("cxx")
local compflags = compinst:compflags({sourcefile = file, target = target})
-- 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
- compflags = table.remove_if(compflags, function(_, flag) return flag:startswith("-fmodule") end)
+ table.remove_if(compflags, function(_, flag) return flag:startswith("-fmodule") end)
local ifile = path.translate(path.join(outputdir, path.filename(file) .. ".i"))
os.vrunv(compinst:program(), table.join(common_args, compflags, {file, "-o", ifile}))
local content = io.readfile(ifile)