mirror of
https://github.com/NixOS/nix
synced 2025-07-10 08:53:55 +02:00
Create compile-commands.json with Make
This commit is contained in:
parent
5c8983b9e6
commit
83fc988bec
5 changed files with 55 additions and 3 deletions
11
mk/compilation-database.mk
Normal file
11
mk/compilation-database.mk
Normal file
|
@ -0,0 +1,11 @@
|
|||
compile-commands-json-files :=
|
||||
|
||||
define write-compile-commands
|
||||
_srcs := $$(sort $$(foreach src, $$($(1)_SOURCES), $$(src)))
|
||||
|
||||
$(1)_COMPILE_COMMANDS_JSON := $$(addprefix $(buildprefix), $$(addsuffix .compile_commands.json, $$(basename $$(_srcs))))
|
||||
|
||||
compile-commands-json-files += $$($(1)_COMPILE_COMMANDS_JSON)
|
||||
|
||||
clean-files += $$($(1)_COMPILE_COMMANDS_JSON)
|
||||
endef
|
Loading…
Add table
Add a link
Reference in a new issue