Re: [webkit-dev] Using compile_command.json in sources that go into Unified Sources
O Lun, 26-03-2018 ás 14:30 +0100, Adrian Perez de Castro escribiu: > > I *think* that many tools like scan-build should work equally well > regardless > of whether the compilation database contains the unifies or the > individual > sources. But of course it's difficult to predict what every other > tool will > do, so it's impossible to be sure :-\ There are many tools that do require to have the individual sources. For example ycm (we already have a config file for it in tree) requires the user to define a callback which just receives a file name (the one being opened in the IDE) and returns the compilation flags for that file. Should we have a way to get the unified source where each individual file was added we could solve this easily. BR ___ webkit-dev mailing list webkit-dev@lists.webkit.org https://lists.webkit.org/mailman/listinfo/webkit-dev
Re: [webkit-dev] Using compile_command.json in sources that go into Unified Sources
O Sáb, 24-03-2018 ás 23:03 +, Cadu Bentzen escribiu: > Hi WebKit developers, > > Recently I started coding in WebKitGTK+ on Linux and I realized that > source files that are batch-compiled in UnifiedSources don't get an > entry in compile_commands.json, making it difficult to get flags for > autocompletion, "go-to definition" and conditional highlighting > feature in IDEs. I opened https://bugs.webkit.org/show_bug.cgi?id=182689 some time ago to track this issue. BR ___ webkit-dev mailing list webkit-dev@lists.webkit.org https://lists.webkit.org/mailman/listinfo/webkit-dev
Re: [webkit-dev] Using compile_command.json in sources that go into Unified Sources
26.03.2018, 16:31, "Adrian Perez de Castro" : > On Mon, 26 Mar 2018 07:54:38 -0500, Michael Catanzaro > wrote: >> On Sat, Mar 24, 2018 at 6:03 PM, Cadu Bentzen >> wrote: >> > I included calling this script at the end of the build-webkit (under >> > a command line option) script. So far it has work for me, but I >> > wonder if this is the right approach or if you already solved that in >> > another way. >> >> Is compile_commands.json intended only for use by IDEs? If it's not >> going to break anything, then this seems reasonable to me. I would go >> ahead and submit a patch for review on bugs.webkit.org, and leave a >> link to it in this thread. > > At least I know also that the “scan-build” implementation in Python [1] uses > the compilation database (in my experience it is easier to get running than > Clang's, and is what I have used in the past to run the Clang analyzer on the > WebKit code). A lot of other clang-based tools use this file, most notably clang-tidy. > > I *think* that many tools like scan-build should work equally well regardless > of whether the compilation database contains the unifies or the individual > sources. But of course it's difficult to predict what every other tool will > do, so it's impossible to be sure :-\ > > Didn't we have a CMake flag that disabled unified sources completely? Maybe > people who want to use “compile_commands.json” with IDEs can just use that… > > Cheers, > > -- > Adrián 🎩 > , > > ___ > webkit-dev mailing list > webkit-dev@lists.webkit.org > https://lists.webkit.org/mailman/listinfo/webkit-dev -- Regards, Konstantin ___ webkit-dev mailing list webkit-dev@lists.webkit.org https://lists.webkit.org/mailman/listinfo/webkit-dev
Re: [webkit-dev] Using compile_command.json in sources that go into Unified Sources
On Mon, 26 Mar 2018 07:54:38 -0500, Michael Catanzaro wrote: > On Sat, Mar 24, 2018 at 6:03 PM, Cadu Bentzen > wrote: > > I included calling this script at the end of the build-webkit (under > > a command line option) script. So far it has work for me, but I > > wonder if this is the right approach or if you already solved that in > > another way. > > Is compile_commands.json intended only for use by IDEs? If it's not > going to break anything, then this seems reasonable to me. I would go > ahead and submit a patch for review on bugs.webkit.org, and leave a > link to it in this thread. At least I know also that the “scan-build” implementation in Python [1] uses the compilation database (in my experience it is easier to get running than Clang's, and is what I have used in the past to run the Clang analyzer on the WebKit code). I *think* that many tools like scan-build should work equally well regardless of whether the compilation database contains the unifies or the individual sources. But of course it's difficult to predict what every other tool will do, so it's impossible to be sure :-\ Didn't we have a CMake flag that disabled unified sources completely? Maybe people who want to use “compile_commands.json” with IDEs can just use that… Cheers, -- Adrián 🎩 pgpxehPRGlYiz.pgp Description: PGP signature ___ webkit-dev mailing list webkit-dev@lists.webkit.org https://lists.webkit.org/mailman/listinfo/webkit-dev
Re: [webkit-dev] Using compile_command.json in sources that go into Unified Sources
On Sat, Mar 24, 2018 at 6:03 PM, Cadu Bentzen wrote: I included calling this script at the end of the build-webkit (under a command line option) script. So far it has work for me, but I wonder if this is the right approach or if you already solved that in another way. Is compile_commands.json intended only for use by IDEs? If it's not going to break anything, then this seems reasonable to me. I would go ahead and submit a patch for review on bugs.webkit.org, and leave a link to it in this thread. Michael ___ webkit-dev mailing list webkit-dev@lists.webkit.org https://lists.webkit.org/mailman/listinfo/webkit-dev
[webkit-dev] Using compile_command.json in sources that go into Unified Sources
Hi WebKit developers, Recently I started coding in WebKitGTK+ on Linux and I realized that source files that are batch-compiled in UnifiedSources don't get an entry in compile_commands.json, making it difficult to get flags for autocompletion, "go-to definition" and conditional highlighting feature in IDEs. Do you currently have a workaround for that? In my local branch I wrote a script to "expand" compile_commands.json entries of UnifiedSources into entries of the source files contained in them. For example, if JavascriptScore/UnifiedSource2.cpp has #include "API/JSBase.cpp" #include "API/JSCTestRunnerUtils.cpp" #include "API/JSCallbackConstructor.cpp" The script replaces the entry of UnifiedSource2.cpp by three entries (one for each source file) with the same flags but replacing the "file" field with the path to those source files. I included calling this script at the end of the build-webkit (under a command line option) script. So far it has work for me, but I wonder if this is the right approach or if you already solved that in another way. Best regards, Cadu Bentzen. ___ webkit-dev mailing list webkit-dev@lists.webkit.org https://lists.webkit.org/mailman/listinfo/webkit-dev