make: generate compile_commands.json for all .cpp files

Best to have all .cpp files in compile_commands.json
so they can all benefit from the tools that leverage
it. So now we recursively generate the file for all
.cpp files in all subdirectories. Most notably, now
all test files are included.

Change-Id: I312d812463607b32fe6b9e83b10900c17ae86185
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
pull/6252/head
Ashod Nakashian 2023-04-20 11:36:14 -04:00 committed by Ashod Nakashian
parent 86c1dca7b6
commit d8d88c740d
1 changed files with 1 additions and 7 deletions

View File

@ -122,8 +122,6 @@ if ENABLE_SSL
shared_sources += net/Ssl.cpp
endif
shared_json = $(patsubst %.cpp,%.cmd,$(shared_sources))
coolwsd_sources = common/Crypto.cpp \
wsd/Admin.cpp \
wsd/AdminModel.cpp \
@ -142,8 +140,6 @@ coolwsd_sources = common/Crypto.cpp \
wsd/ProofKey.cpp \
wsd/QuarantineUtil.cpp
coolwsd_json = $(patsubst %.cpp,%.cmd,$(coolwsd_sources))
coolwsd_SOURCES = $(coolwsd_sources) \
$(shared_sources)
@ -182,8 +178,6 @@ coolforkit_sources = kit/ChildSession.cpp \
kit/ForKit.cpp \
kit/Kit.cpp
coolforkit_json = $(patsubst %.cpp,%.cmd,$(coolforkit_sources))
coolforkit_SOURCES = $(coolforkit_sources) \
$(shared_sources)
@ -595,7 +589,7 @@ CLANGXX_COMPILE_FLAGS=clang++ $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
JSON_COMPILE_FLAGS=$(subst ",\",$(subst \,\\,$(CLANGXX_COMPILE_FLAGS)))
JSON_COMPILE_SRC = $(coolwsd_json) $(coolforkit_json) $(shared_json)
JSON_COMPILE_SRC = $(patsubst %.cpp,%.cmd,$(wildcard **/*.cpp))
$(eval $(call file_targets,$(JSON_COMPILE_SRC)))