Permalink
Browse files

Specify language with language option for gcc, clang, VC++.

Compiler errors if file has no suffix without langauge option.
  • Loading branch information...
syohex committed Nov 14, 2012
1 parent 896c3f6 commit be8a079cd09b46b54275bed74c6ec26b478927e1
Showing with 9 additions and 9 deletions.
  1. +9 −9 quickrun.el
View
@@ -66,48 +66,48 @@
(defvar quickrun/language-alist
'(("c/gcc" . ((:command . "gcc")
- (:exec . ("%c %o -o %e %s" "%e %a"))
+ (:exec . ("%c -x c %o -o %e %s" "%e %a"))
(:compile-only . "%c -Wall -Werror %o -o %e %s")
(:remove . ("%e"))
(:description . "Compile C file with gcc and execute")))
("c/clang" . ((:command . "clang")
- (:exec . ("%c %o -o %e %s" "%e %a"))
+ (:exec . ("%c -x c %o -o %e %s" "%e %a"))
(:compile-only . "%c -Wall -Werror %o -o %e %s")
(:remove . ("%e"))
(:description . "Compile C file with llvm/clang and execute")))
("c/cl" . ((:command . "cl")
- (:exec . ("%c %o %s /nologo /Fo%n.obj /Fe%n.exe"
+ (:exec . ("%c /Tc %o %s /nologo /Fo%n.obj /Fe%n.exe"
"%n %a"))
(:compile-only . "%c %o %s /Wall /nologo /Fo%n.obj /Fe%n.exe")
(:remove . ("%n.obj" "%n.exe"))
(:description . "Compile C file with VC++/cl and execute")))
("c++/g++" . ((:command . "g++")
- (:exec . ("%c %o -o %e %s" "%e %a"))
+ (:exec . ("%c -x c++ %o -o %e %s" "%e %a"))
(:compile-only . "%c -Wall -Werror %o -o %e %s")
(:remove . ("%e"))
(:description . "Compile C++ file with g++ and execute")))
("c++/clang++" . ((:command . "clang++")
- (:exec . ("%c %o -o %e %s" "%e %a"))
+ (:exec . ("%c -x c++ %o -o %e %s" "%e %a"))
(:compile-only . "%c -Wall -Werror %o -o %e %s")
(:remove . ("%e"))
(:description . "Compile C++ file with llvm/clang++ and execute")))
("c++/cl" . ((:command . "cl")
- (:exec . ("%c %o %s /nologo /Fo%n.obj /Fe%n.exe"
+ (:exec . ("%c /Tp %o %s /nologo /Fo%n.obj /Fe%n.exe"
"%n %a"))
(:compile-only . "%c %o %s /Wall /nologo /Fo%n.obj /Fe%n.exe")
(:remove . ("%n.obj" "%n.exe"))
(:description . "Compile C++ file with VC/cl and execute")))
("objc" . ((:command . "gcc")
(:exec . ((lambda ()
- (cond ((string= system-type "darwin")
- "%c %o -o %e %s -framework foundation")
- (t "%c %o -o %e %s -lobjc")))
+ (if (string= system-type "darwin")
+ "%c -x objective-c %o -o %e %s -framework foundation"
+ "%c -x objective-c %o -o %e %s -lobjc"))
"%e %a"))
(:remove . ("%e"))
(:description . "Compile Objective-C file with gcc and execute")))

0 comments on commit be8a079

Please sign in to comment.