Created
October 29, 2013 01:58
-
-
Save fasheng/7208018 to your computer and use it in GitHub Desktop.
Add semantic system include DIR through pkg-config.
Usage: (fsh-semantic-pkg-config "gtk+-2.0 webkit-1.0..." 'c-mode)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defun fsh-semantic-pkg-config (libs mode) | |
"Add semantic system include DIR through pkg-config. | |
Usage: (fsh-semantic-pkg-config \"gtk+-2.0 QtGui QtNetwork...\" 'c-mode)" | |
(let* ((pkg-cmd "pkg-config") | |
(pkg-opt (format "--cflags %s" libs))) | |
(setq result (shell-command-to-string (format "%s %s" pkg-cmd pkg-opt))) | |
(dolist (str (split-string result)) | |
(if (string-match-p "^-I" str) | |
(semantic-add-system-include (substring str 2 nil) mode) | |
)))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment