branch: elpa/swift-mode commit 3e8befa3960232bdb94f111faa2f90fe14d5a930 Merge: a1d7a06 e6f1a3c Author: Bozhidar Batsov <bozhidar.bat...@gmail.com> Commit: Bozhidar Batsov <bozhidar.bat...@gmail.com>
Merge pull request #92 from apiology/more_flycheck_option_vars More configurability for flycheck --- swift-mode.el | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/swift-mode.el b/swift-mode.el index 3c506b4..6121b0a 100644 --- a/swift-mode.el +++ b/swift-mode.el @@ -593,6 +593,23 @@ :type '(repeat (directory :tag "Include directory")) :safe #'flycheck-string-list-p) + (flycheck-def-option-var flycheck-swift-cc-include-search-paths nil swift + "A list of include file search paths to pass to the Objective C compiler" + :type '(repeat (directory :tag "Include directory")) + :safe #'flycheck-string-list-p) + + (flycheck-def-option-var flycheck-swift-target "i386-apple-ios8.1" swift + "Target used by swift compiler" + :type '(choice (const :tag "Don't specify target" nil) + (string :tag "Build target")) + :safe #'stringp) + + (flycheck-def-option-var flycheck-swift-import-objc-header nil swift + "Objective C header file to import, if any" + :type '(choice (const :tag "Don't specify objective C bridging header" nil) + (string :tag "Objective C bridging header path")) + :safe #'stringp) + (flycheck-define-checker swift "Flycheck plugin for for Apple's Swift programming language." :command ("swift" @@ -614,6 +631,12 @@ (eq (string-match ".#" path) nil) (eq (string-match file path) nil))) (file-expand-wildcards flycheck-swift-linked-sources))))) + (option "-target" flycheck-swift-target) + (option "-import-objc-header" flycheck-swift-import-objc-header) + (eval + (mapcan + #'(lambda (path) (list "-Xcc" (concat "-I" path))) + flycheck-swift-cc-include-search-paths)) "-primary-file" source) :error-patterns ((error line-start (file-name) ":" line ":" column ": "