summaryrefslogtreecommitdiff
path: root/xmake/rules/c++/modules
diff options
context:
space:
mode:
authorArthur LAURENT <[email protected]>2023-01-14 15:52:28 +0100
committerArthur LAURENT <[email protected]>2023-01-14 15:44:42 +0100
commit3f907fe73417fc308626adcc2c619da804c60b04 (patch)
tree0129e114248f98680c874df9a176420b7b6e1b92 /xmake/rules/c++/modules
parent020786b7f39a682ef6486e0a342d2c02f8c42308 (diff)
add policy to force enable fallback module dependency scanner
Diffstat (limited to 'xmake/rules/c++/modules')
-rw-r--r--xmake/rules/c++/modules/modules_support/clang.lua2
-rw-r--r--xmake/rules/c++/modules/modules_support/gcc.lua2
-rw-r--r--xmake/rules/c++/modules/modules_support/msvc.lua2
3 files changed, 3 insertions, 3 deletions
diff --git a/xmake/rules/c++/modules/modules_support/clang.lua b/xmake/rules/c++/modules/modules_support/clang.lua
index bc07c28cf..5680c1eac 100644
--- a/xmake/rules/c++/modules/modules_support/clang.lua
+++ b/xmake/rules/c++/modules/modules_support/clang.lua
@@ -252,7 +252,7 @@ function generate_dependencies(target, sourcebatch, opt)
end
local jsonfile = path.translate(path.join(outputdir, path.filename(sourcefile) .. ".json"))
- if has_clangscandepssupport(target) then
+ if has_clangscandepssupport(target) and not target:policy("build.c++.clang.fallbackscanner") then
local clangscandeps = find_tool("clang-scan-deps")
local compinst = target:compiler("cxx")
local compflags = compinst:compflags({sourcefile = file, target = target})
diff --git a/xmake/rules/c++/modules/modules_support/gcc.lua b/xmake/rules/c++/modules/modules_support/gcc.lua
index 1180fde19..07b4d130b 100644
--- a/xmake/rules/c++/modules/modules_support/gcc.lua
+++ b/xmake/rules/c++/modules/modules_support/gcc.lua
@@ -190,7 +190,7 @@ function generate_dependencies(target, sourcebatch, opt)
end
local jsonfile = path.translate(path.join(outputdir, path.filename(sourcefile) .. ".json"))
- if depformatflag and depfileflag and depoutputflag then
+ if depformatflag and depfileflag and depoutputflag and not target:policy("build.c++.gcc.fallbackscanner") then
local ifile = path.translate(path.join(outputdir, path.filename(sourcefile) .. ".i"))
local dfile = path.translate(path.join(outputdir, path.filename(sourcefile) .. ".d"))
local args = {sourcefile, "-MT", jsonfile, "-MD", "-MF", dfile, depformatflag, depfileflag .. jsonfile, depoutputflag .. target:objectfile(sourcefile), "-o", ifile}
diff --git a/xmake/rules/c++/modules/modules_support/msvc.lua b/xmake/rules/c++/modules/modules_support/msvc.lua
index 23e5d765f..3d4e03db2 100644
--- a/xmake/rules/c++/modules/modules_support/msvc.lua
+++ b/xmake/rules/c++/modules/modules_support/msvc.lua
@@ -197,7 +197,7 @@ function generate_dependencies(target, sourcebatch, opt)
end
local jsonfile = path.join(outputdir, path.filename(sourcefile) .. ".json")
- if scandependenciesflag then
+ if scandependenciesflag and not target:policy("build.c++.msvc.fallbackscanner") then
local flags = {jsonfile, sourcefile, "-Fo" .. target:objectfile(sourcefile)}
_compile(target, table.join(common_flags, flags), sourcefile)
else