From e3aff6c36cf522db3bae083fa8931ddf328898a1 Mon Sep 17 00:00:00 2001 From: Jason Rhinelander Date: Thu, 25 Feb 2021 12:50:34 -0400 Subject: [PATCH] Add more junk & clangd symlinks to .gitignore Ignore any root directory starting with build so that you can have many build directories (build, build2, build-win32, ...) that get ignored. Add .cache which clangd creates Ignore compile_commands.json (and generate it by default) which helps clangd, but needs to be symlinked to a compile_commands.json in a build dir so isn't suitable for inclusion in the repo. --- .gitignore | 4 +++- CMakeLists.txt | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 2a1d2239a..27e57ba86 100644 --- a/.gitignore +++ b/.gitignore @@ -5,7 +5,7 @@ *.o *.so -build/ +/build*/ **/__pycache__/** llarpd @@ -18,6 +18,8 @@ CMakeFiles CMakeCache.txt .ninja_log .ninja_deps +/.cache/ +/compile_commands.json callgrind.* .gdb_history diff --git a/CMakeLists.txt b/CMakeLists.txt index d5897f235..fea0cc207 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,5 +1,7 @@ cmake_minimum_required(VERSION 3.10) # bionic's cmake version +set(CMAKE_EXPORT_COMPILE_COMMANDS ON) + # Has to be set before `project()`, and ignored on non-macos: set(CMAKE_OSX_DEPLOYMENT_TARGET 10.12 CACHE STRING "macOS deployment target (Apple clang only)")