diff options
| author | ruki <[email protected]> | 2022-12-29 23:23:19 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2022-12-29 23:23:19 +0800 |
| commit | 6a8bfb31c92db3e50e6bd21dbe2c6051b87d00fb (patch) | |
| tree | 58c0d1a75089d86740e3abf4fec266f62ef41ae2 | |
| parent | e9d9ce727014d392a5c05619528649f8b238a9ed (diff) | |
we enable pcheader for clangd
| -rw-r--r-- | xmake/plugins/project/clang/compile_commands.lua | 9 |
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 |
