MAKE: create compile_commands.json symlink in the root of the project

this allows easier integration of clangd
master
Martin Gerhardy 2020-09-03 00:45:41 +02:00
parent 748cfd259b
commit d6cf59b4dd
1 changed files with 2 additions and 0 deletions

View File

@ -14,6 +14,7 @@ CMAKE_OPTIONS ?= -DCMAKE_BUILD_TYPE=$(BUILDTYPE) -G$(GENERATOR) --graphviz=$(BU
all:
$(Q)if [ ! -f $(BUILDDIR)/CMakeCache.txt ]; then $(CMAKE) -H$(CURDIR) -B$(BUILDDIR) $(CMAKE_OPTIONS); fi
$(Q)$(CMAKE) --build $(BUILDDIR) --target $@
$(Q)$(CMAKE) -E create_symlink build/Debug/compile_commands.json compile_commands.json
release:
$(Q)$(MAKE) BUILDTYPE=Release
@ -41,6 +42,7 @@ release-%:
$(Q)if [ ! -f $(BUILDDIR)/CMakeCache.txt ]; then $(CMAKE) -H$(CURDIR) -B$(BUILDDIR) $(CMAKE_OPTIONS); fi
$(Q)$(CMAKE) --build $(BUILDDIR) --target $@
$(Q)$(CMAKE) --install $(BUILDDIR) --component $@ --prefix $(INSTALL_DIR)/install-$@
$(Q)$(CMAKE) -E create_symlink build/Debug/compile_commands.json compile_commands.json
dependency-%:
$(Q)$(CMAKE) -H$(CURDIR) -B$(BUILDDIR) $(CMAKE_OPTIONS)