From a686688f3085c13b1ab7f8749c22ce13d03b96ca Mon Sep 17 00:00:00 2001 From: Xavier Bestel Date: Thu, 31 Mar 2022 14:14:29 +0200 Subject: [PATCH] generate compile_commands.json for IDEs --- CMakeLists.txt | 3 +++ compile_commands.json | 1 + 2 files changed, 4 insertions(+) create mode 120000 compile_commands.json diff --git a/CMakeLists.txt b/CMakeLists.txt index b362caa..34a60e9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -10,6 +10,9 @@ set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_STANDARD_REQUIRED ON) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -O2") +# Help LSP-based IDEs (VSCode, Neovim, etc.) +set(CMAKE_EXPORT_COMPILE_COMMANDS ON) + # add the binary tree to the search path for include files include_directories(${PROJECT_SOURCE_DIR}) include_directories(${CMAKE_CURRENT_BINARY_DIR}) diff --git a/compile_commands.json b/compile_commands.json new file mode 120000 index 0000000..25eb4b2 --- /dev/null +++ b/compile_commands.json @@ -0,0 +1 @@ +build/compile_commands.json \ No newline at end of file