File tree Expand file tree Collapse file tree 2 files changed +9
-0
lines changed
Expand file tree Collapse file tree 2 files changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -6,3 +6,4 @@ __pycache__/
66.vscode /
77/build /
88/out /
9+ compile_commands.json
Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ BUILD_TESTS ?= ON # pass BUILD_TESTS=OFF to skip
77BUILD_BENCH ?= OFF
88BUILD_TOOLS ?= OFF
99BUILD_TYPE ?= Debug # Release | RelWithDebInfo ...
10+ COMPILE_COMMANDS ?= ON
1011JOBS ?= $(shell nproc 2>/dev/null || sysctl -n hw.ncpu)
1112
1213CMAKE_FLAGS = \
@@ -15,13 +16,17 @@ CMAKE_FLAGS = \
1516 -DBUILD_TESTING=$(BUILD_TESTS ) \
1617 -DBUILD_BENCHMARKS=$(BUILD_BENCH ) \
1718 -DBUILD_TOOLS=$(BUILD_TOOLS ) \
19+ -DCMAKE_EXPORT_COMPILE_COMMANDS=$(COMPILE_COMMANDS )
1820
1921.PHONY : build test bench tools \
2022 format clean distclean help
2123
2224configure :
2325 @mkdir -p " $( BUILD_DIR) "
2426 @cmake -S . -B " $( BUILD_DIR) " $(CMAKE_FLAGS )
27+ ifeq ($(COMPILE_COMMANDS ) ,ON)
28+ @ln -sf "$(BUILD_DIR)/compile_commands.json" compile_commands.json
29+ endif
2530
2631build : configure
2732 @cmake --build " $( BUILD_DIR) " -- -j$(JOBS )
5358
5459distclean :
5560 @rm -rf " $( BUILD_DIR) "
61+ ifeq ($(COMPILE_COMMANDS ) ,ON)
62+ @rm -f compile_commands.json
63+ endif
5664
5765help :
5866 @echo " Targets:"
You can’t perform that action at this time.
0 commit comments