simutrans icon indicating copy to clipboard operation
simutrans copied to clipboard

Add an option to the Makefile for creating compile_command.sjson

Open johannes opened this issue 5 years ago • 1 comments

compile_command.json is a compilation database files used by different clangd based IDEs and editors for more accurate code completion.

In this patch a make target compile-commands is added as a PHONY target which creates such a file. The target is PHONY for easy updating of the database file.

The logic used for creating is trivial and will treat all files as C++ (even the .m, .mm and .c files) and won't do escaping of " in any path. The resulting file is created in the root directory, not inside the build dir, so IDEs and tools can find it easily.

Information on compile_commands.json can be found on https://clang.llvm.org/docs/JSONCompilationDatabase.html

johannes avatar Sep 21 '19 18:09 johannes

Hello, this repository is just a mirror of the original svn repository. You can try submitting your PR as an svn compatible patch (git diff --no-prefix) to the Simutrans forum here.

ceeac avatar Sep 24 '19 09:09 ceeac