summaryrefslogtreecommitdiff
path: root/xmake/modules/core/tools/cl.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2022-05-29 16:01:44 +0800
committerruki <[email protected]>2022-05-29 16:01:44 +0800
commit53e8d28f6f8f1ebe5bd33b7733aef9c878251f78 (patch)
treeb8b4317c652563767ef52c68d7d9e46a16564c44 /xmake/modules/core/tools/cl.lua
parentef6baaf4b1d333d330d6c44810fc3544c1e5d8f5 (diff)
add linemarkers policy
Diffstat (limited to 'xmake/modules/core/tools/cl.lua')
-rw-r--r--xmake/modules/core/tools/cl.lua14
1 files changed, 14 insertions, 0 deletions
diff --git a/xmake/modules/core/tools/cl.lua b/xmake/modules/core/tools/cl.lua
index a832dab4c..fdcce6d45 100644
--- a/xmake/modules/core/tools/cl.lua
+++ b/xmake/modules/core/tools/cl.lua
@@ -450,6 +450,17 @@ function _preprocess(program, argv, opt)
return false
end
+ -- disable linemarkers?
+ local linemarkers = _g.linemarkers
+ if linemarkers == nil then
+ if os.isfile(os.projectfile()) and project.policy("preprocessor.linemarkers") == false then
+ linemarkers = false
+ else
+ linemarkers = true
+ end
+ _g.linemarkers = linemarkers
+ end
+
-- do preprocess
local cppfile = path.join(path.directory(objectfile), path.basename(objectfile) .. path.extension(sourcefile))
local cppfiledir = path.directory(cppfile)
@@ -457,6 +468,9 @@ function _preprocess(program, argv, opt)
os.mkdir(cppfiledir)
end
table.insert(cppflags, "-P")
+ if linemarkers == false then
+ table.insert(cppflags, "-EP")
+ end
table.insert(cppflags, "-Fi" .. cppfile)
table.insert(cppflags, sourcefile)
return try{ function()