Skip to content

Read cflags from ini-style file#35

Open
kschn wants to merge 1 commit intoGolevka:masterfrom
kschn:master
Open

Read cflags from ini-style file#35
kschn wants to merge 1 commit intoGolevka:masterfrom
kschn:master

Conversation

@kschn
Copy link

@kschn kschn commented Apr 30, 2013

With my patch cflags can be read from an ini styled file.

The format of the file looks like this:

[<path/to/project>]
-I
-D
...

The file is read every time a new clang-complete process is created. This way
one can update the cflags file and the changes will be applied as soon a file is
newly opened.
The paths to the include directories are expanded relative to the path within
the brackets, if they are relative. None, one or more sections my apply to a
single source file if the paths within the braces lay in the path of the current
source file:

source file: ~/src/myproj/subdir/module.cpp

cflags-file:

[~]
...

[~/src/myproj]
...

[~/src/myproj/subdir]
...

[~/src/otherproj]
...

If the file /src/myproj/subdir/module.cpp is visited the flags from the
sections [
], [/src/myproj] and [/src/myproj/subdir] are applied to this file.

The file, which is used to fill the cflags variable, can be customized by setting
the variable ac-clang-cflags-file.

@zougloub
Copy link

zougloub commented Jan 5, 2014

Hi, take a look at http://clang.llvm.org/docs/JSONCompilationDatabase.html and you could submit a much more useful patch. Note that CMake and waf can generate the clang compilation database.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants