From 6a8bfb31c92db3e50e6bd21dbe2c6051b87d00fb Mon Sep 17 00:00:00 2001 From: ruki Date: Thu, 29 Dec 2022 23:23:19 +0800 Subject: we enable pcheader for clangd --- xmake/plugins/project/clang/compile_commands.lua | 9 +++++---- 1 file 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 -- cgit v1.3.1