https://bugs.llvm.org/show_bug.cgi?id=41924

            Bug ID: 41924
           Summary: Add ability to pass extra flags to clangd
           Product: clang-tools-extra
           Version: unspecified
          Hardware: PC
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: clangd
          Assignee: unassignedclangb...@nondot.org
          Reporter: tdh...@gmail.com
                CC: llvm-bugs@lists.llvm.org

I have a CMake project which produces a compile_commands.json file. I'm using
it with the clangd VSCode extension. I'm thinking about moving to that from Qt
Creator. However one thing Qt Creator does a lot better is that you can specify
the warning flags for its code model and have them distinct from the actual
CMake compilation flags.

For example in CMake I basically have `-Wall -Wextra -Werror`. But in Qt
Creator I have `-Weverything` which is great when editing files because I get
nice inline warnings about stuff I might not have thought about.

I obviously don't want to enabled `-Weverything -Werror` in my actual build, so
is there a way to have Clangd use different diagnostic flags to the actual
build.

Solutions I have discounted:

* Add `compile_flags.txt` containing `-Wno-error -Weverything`. I haven't
actually tried this but looking at the source code it looks like you can't use
`compile_flags.txt` *and* `compiled_commands.json`.

* Run `compile_commands.json` through a script that modifies it. I really don't
want to do this because then clangd can't monitor it for changes (I'm not sure
that actually happens in practice but it *should* happen).

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to