Skip to content

Commit ba48f19

Browse files
committed
generate support file for clangd language server
1 parent ad4c624 commit ba48f19

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ language
3636
*.so
3737
*.rej
3838
.checkstyle
39+
/graalpython/com.oracle.graal.python.cext/compile_flags.txt
3940
/graalpython/com.oracle.graal.python/src/com/oracle/graal/python/parser/antlr/*.interp
4041
/graalpython/com.oracle.graal.python/src/com/oracle/graal/python/parser/antlr/*.tokens
4142
/graalpython/com.oracle.graal.python/src/com/oracle/graal/python/parser/antlr/Python3*.java

graalpython/com.oracle.graal.python.cext/Makefile

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ MODULE_OBJ_FILES=$(MODULE_SOURCES:%.c=%.o)
4949
MODULE_TARGETS=$(MODULE_SOURCES:modules/%.c=${LIBDIR}/modules/%.bc)
5050

5151
.PHONY: default clean
52-
default: ${TARGET_LIB} ${MODULE_TARGETS}
52+
default: ${TARGET_LIB} ${MODULE_TARGETS} compile_flags.txt
5353

5454

5555
CFLAGS=${LLVM_TARGET_FLAGS} -O1 -ggdb -emit-llvm
@@ -82,6 +82,13 @@ clean:
8282
$(QUIETLY) rm -f ${OBJ_FILES}
8383
$(QUIETLY) rm -f ${MODULE_TARGETS}
8484
$(QUIETLY) rm -f ${MODULE_OBJ_FILES}
85+
$(QUIETLY) rm -f compile_flags.txt
8586
ifeq ($(wildcard ../com.oracle.graal.python.test/src/tests/cpyext/*.bc),)
8687
rm -f $(wildcard ../com.oracle.graal.python.test/src/tests/cpyext/*.bc)
8788
endif
89+
90+
# compile_flags.txt is useful with clangd as language server
91+
compile_flags.txt: Makefile
92+
$(QUIETLY) rm -f $@
93+
$(QUIETLY) $(foreach var,$(WARNINGS),$(file >> $@,$(var)))
94+
$(QUIETLY) $(foreach var,$(INCLUDES),$(file >> $@,$(var)))

0 commit comments

Comments
 (0)