Skip to content
This repository has been archived by the owner on Feb 3, 2024. It is now read-only.

Commit

Permalink
Issue #8 implemented; Project specific clang options.
Browse files Browse the repository at this point in the history
  • Loading branch information
quarnster committed Jan 11, 2012
1 parent 96c31f5 commit 3369e6b
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 1 deletion.
23 changes: 23 additions & 0 deletions SublimeClang.sublime-settings
Expand Up @@ -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",
Expand Down
7 changes: 6 additions & 1 deletion sublimeclang.py
Expand Up @@ -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":
Expand Down

0 comments on commit 3369e6b

Please sign in to comment.