Dan Elkouby vor 10 Jahren
Ursprung
Commit
e6045f0254
3 geänderte Dateien mit 6 neuen und 35 gelöschten Zeilen
  1. 2 32
      .ycm_extra_conf.py
  2. 1 0
      platform/nspire/rules.mk
  3. 3 3
      rules.mk

+ 2 - 32
.ycm_extra_conf.py

@@ -35,38 +35,8 @@ import subprocess
 # These are the compilation flags that will be used in case there's no
 # compilation database set (by default, one is not set).
 # CHANGE THIS LIST OF FLAGS. YES, THIS IS THE DROID YOU HAVE BEEN LOOKING FOR.
-flags = [
-'-Wall',
-'-Wextra',
-#'-Werror',
-'-Wno-long-long',
-'-Wno-variadic-macros',
-'-fexceptions',
-'-DNDEBUG',
-'-m32',
-# You 100% do NOT need -DUSE_CLANG_COMPLETER in your flags; only the YCM
-# source code needs it.
-'-DUSE_CLANG_COMPLETER',
-# THIS IS IMPORTANT! Without a "-std=<something>" 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=<something>".
-# For a C project, you would set this to something like 'c99' instead of
-# 'c++11'.
-'-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.
-# For a C project, you would set this to 'c' instead of 'c++'.
-'-x',
-'c++',
-'-isystem',
-os.environ['NDLESS_GIT'] + '/ndless-sdk/include',
-'-isystem',
-os.environ['HOME'] + '/.ndless/include',
-]
-
-flags += subprocess.check_output(["make", "include"]).split(" ")
+flags = ['-x', 'c++']
+flags += subprocess.check_output(["make", "cflags"]).split(" ")
 
 
 # Set this to the absolute path to the folder (NOT the file!) containing the

+ 1 - 0
platform/nspire/rules.mk

@@ -5,6 +5,7 @@ SRCS_CPP += $(wildcard $(nspire_LOCAL_PATH)/*.cpp)
 INCLUDE += $(nspire_LOCAL_PATH)/public
 
 CFLAGS_COMMON += -marm -DNSPIRE=1
+YCM_EXTRA_CFLAGS := -m32 -I$(NDLESS_GIT)/ndless-sdk/include -I$(HOME)/.ndless/include
 
 CC = nspire-gcc
 CPP = nspire-g++

+ 3 - 3
rules.mk

@@ -1,4 +1,4 @@
-.PHONY: format clean all run versionning include release bundle
+.PHONY: format clean all run versionning cflags release bundle
 
 all: $(EXE)
 
@@ -52,7 +52,7 @@ format:
 	@echo "Formatting source using clang-format"
 	@clang-format -i -style=file $(shell git ls-files -c -o --exclude-standard *.c *.cpp *.h)
 
-include:
-	@echo -n $(addprefix -I ,$(INCLUDE) $(INCLUDE_EXT))
+cflags:
+	@echo -n $(CPPFLAGS) $(YCM_EXTRA_CFLAGS)
 
 .FORCE: