Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Read cflags from ini-style file #35

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

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