From 6a2f8c859cbb50a16263cd46376afd6ac088eb43 Mon Sep 17 00:00:00 2001 From: Strahinja Val Markovic Date: Sat, 11 Aug 2012 19:46:22 -0700 Subject: [PATCH] Using -x c++ in clang opts so that headers compile The problem is that clang loves to assume that .h files are in C. -x c++ gives it a nudge in the right direction. --- cpp/ycm/.ycm_clang_options.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/cpp/ycm/.ycm_clang_options.py b/cpp/ycm/.ycm_clang_options.py index 918acfed..290e6dca 100644 --- a/cpp/ycm/.ycm_clang_options.py +++ b/cpp/ycm/.ycm_clang_options.py @@ -7,12 +7,18 @@ flags = [ '-Wc++98-compat', '-Wno-long-long', '-Wno-variadic-macros', +'-fexceptions', '-DNDEBUG', # THIS IS IMPORTANT! Without a "-std=" flag, clang won't know which # language to use when compiling headers. So it will guess. Badly. So C++ # headers will be compiled as C headers. You don't want that so ALWAYS specify # a "-std=" '-std=c++11', +# ...and the same thing goes for the magic -x option which specifies the +# language that the files to be compiled are written in. This is mostly +# relevant for c++ headers. +'-x', +'c++', '-isystem', '../BoostParts', '-isystem',