Permalink
Browse files

Issue #8 implemented; Project specific clang options.

  • Loading branch information...
1 parent 96c31f5 commit 3369e6befc911fbea306c9f5b52a55e77cba9146 @quarnster committed Jan 11, 2012
Showing with 29 additions and 1 deletion.
  1. +23 −0 SublimeClang.sublime-settings
  2. +6 −1 sublimeclang.py
@@ -63,6 +63,29 @@
"add_language_option": true,
// Any options you want to give to clang
+ // This can also be specified as project specific options. Choose the menu item
+ // Project->Edit Project, and then add something like the following to the
+ // "settings" section:
+ //
+ // "sublimeclang_options":
+ // [
+ // "-I/project/specific/path/1",
+ // "-I/project/specific/path/2"
+ // ]
+ //
+ // If your project does not have a settings section it would look like this:
+ //
+ // "settings":
+ // {
+ // "sublimeclang_options":
+ // [
+ // "-I/project/specific/path/1",
+ // "-I/project/specific/path/2"
+ // ]
+ // }
+ //
+ // If "sublimeclang_options" exists in your project settings, it'll override
+ // rather than add to the "options" defined in SublimeClang.sublime-settings.
"options":
[
"-Wall",
View
@@ -233,8 +233,13 @@ def add(self, view, filename, on_done):
self.parsingList.unlock()
def get_opts(self, view):
+ opts = []
s = get_settings()
- opts = s.get("options", ["-Wall"])
+ if view.settings().has("sublimeclang_options"):
+ opts = view.settings().get("sublimeclang_options")
+ view.settings().add_on_change("sublimeclang_options", self.clear)
+ else:
+ opts = s.get("options", ["-Wall"])
if s.get("add_language_option", True):
language = get_language(view)
if language == "objc":

0 comments on commit 3369e6b

Please sign in to comment.