[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: New Flymake rewrite in emacs-26

From: guillaume papin
Subject: Re: New Flymake rewrite in emacs-26
Date: Wed, 11 Oct 2017 18:39:31 +0000

Regarding the way for a project to export it compile options,
there is somewhat popular, if not standard, method.
Generate a compilation database[1].

A compilation database is a JSON file, named compile_commands.json,
with looks like this for emacs:

            "arguments": [
            "directory": "/home/papin_g/dev/src/emacs/emacs-25.1-build/src",
            "file": "../../emacs/src/intervals.c"

I could generate this with a tool called intercept-build[2],
by doing a clean build of emacs:

    $ intercept-build make
      CC       dbusbind.o
      CC       emacs.o
      CC       keyboard.o
    $ cat compile_commands.json
                "arguments": [

The compile options have the `-M' filtered out by the tool.

I think there is something in CEDET that knows how to load this information for 
see ede-compdb[2], but this is also quite straightforward to do with the `json' 

What the Emacs makefile could do, is generate the JSON file with a command like 
`make compdb'.
I have done this in the past for project using GNU Make, it wasn't too 
difficult to implement.

This is also what the cmake-ide tool mentionned just before seems to be using.

[1] https://clang.llvm.org/docs/JSONCompilationDatabase.html
    Sorry for the link to Clang, it's not really Clang-specific.
[2] https://github.com/rizsotto/scan-build
    Once again, related to Clang, sorry about that.
    Bear is basically the same thing, and maybe easier to install from source:
[3] https://github.com/randomphrase/ede-compdb
    This is a Github link, but it says that this has been integrated into CEDET.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]