[Webkit-unassigned] [Bug 235686] Generate compile_commands.json on macOS Builds
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Wed Feb 2 00:37:35 PST 2022
https://bugs.webkit.org/show_bug.cgi?id=235686
--- Comment #17 from Brandon <brandonstewart at apple.com> ---
(In reply to Elliott Williams from comment #15)
> Comment on attachment 450587 [details]
> Patch
>
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=450587&action=review
>
> Have you considered implementing this logic in our Makefiles? (probably
> Makefile.shared)
>
> I think it'd be possible to have a flag like `make d
> EXPORT_COMPILE_COMMANDS=YES` which would build with the appropriate compiler
> flags, then merge them together to produce a final compile_commands.json.
> There's even precedent for reading Make variables from user defaults, so you
> wouldn't have to remember to pass the flag every build:
> https://github.com/WebKit/WebKit/blob/
> fde694156283fc02d22a32e3d127b3285f424460/Makefile.shared#L50-L51
>
> I don't want to derail, since I know you've been iterating on this already,
> but I think that tying things together in Make would be a UX improvement.
>
You are absolutely right! Modifying make to support something like EXPORT_COMPILE_COMMANDS=YES would be a significant improvement over my proposed method.
> > Tools/Scripts/generate-compile-commands.sh:29
> > +# Script to generate compile_commands.json file
>
> High level thought: Could this be a wiki page? i.e. “To generate compiler
> metadata for VSCode, add these lines to your LocalOverrides.xcconfig”.
>
> In general, I think this kind of thing is easy to express in documentation,
> and we ought to have some documentation for building with non-Xcode editors
> on Mac, so that folks other than us know that this functionality is
> availiable :)
>
A wiki page or an entry on the website is definitely needed. I was just waiting to merge the implementation before writing one up .
> > Tools/Scripts/setup-compile-commands-configuration.sh:35
> > +echo "WARNING_CFLAGS = \"-gen-cdb-fragment-path\" \"/tmp/compile_commands\" \$(inherited)
>
> nit: WARNING_CFLAGS should probably be OTHER_CFLAGS, since these flags don't
> relate to warnings.
--
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20220202/404d8b0f/attachment.htm>
More information about the webkit-unassigned
mailing list