summaryrefslogtreecommitdiff
path: root/xmake/plugins
diff options
context:
space:
mode:
authorruki <[email protected]>2022-12-29 23:23:19 +0800
committerruki <[email protected]>2022-12-29 23:23:19 +0800
commit6a8bfb31c92db3e50e6bd21dbe2c6051b87d00fb (patch)
tree58c0d1a75089d86740e3abf4fec266f62ef41ae2 /xmake/plugins
parente9d9ce727014d392a5c05619528649f8b238a9ed (diff)
we enable pcheader for clangd
Diffstat (limited to 'xmake/plugins')
-rw-r--r--xmake/plugins/project/clang/compile_commands.lua9
1 files changed, 5 insertions, 4 deletions
diff --git a/xmake/plugins/project/clang/compile_commands.lua b/xmake/plugins/project/clang/compile_commands.lua
index 2167981b4..f6cd3bac4 100644
--- a/xmake/plugins/project/clang/compile_commands.lua
+++ b/xmake/plugins/project/clang/compile_commands.lua
@@ -256,10 +256,11 @@ function _make_target(jsonfile, target)
-- enter package environments
local oldenvs = os.addenvs(target:pkgenvs())
- -- TODO
- -- disable precompiled header first
- target:set("pcheader", nil)
- target:set("pcxxheader", nil)
+ -- we enable it for clangd, @see https://github.com/xmake-io/xmake/issues/2818
+ if not lsp or lsp ~= "clangd" then
+ target:set("pcheader", nil)
+ target:set("pcxxheader", nil)
+ end
-- build source batches
for _, sourcebatch in pairs(target:sourcebatches()) do