cmake: Generate compile_commands.json on configure. (#2559)
authorMathias Preiner <mathias.preiner@gmail.com>
Mon, 1 Oct 2018 23:37:15 +0000 (16:37 -0700)
committerAndres Noetzli <andres.noetzli@gmail.com>
Mon, 1 Oct 2018 23:37:15 +0000 (16:37 -0700)
CMakeLists.txt

index a42406dad75087f331dfd451b6ebf3f89c566e30..e850f99289ba1bf3ca72a02a0bab6f4c2a14fbb2 100644 (file)
@@ -27,6 +27,10 @@ set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake)
 set(CMAKE_C_STANDARD 99)
 set(CMAKE_CXX_STANDARD 11)
 
+# Generate compile_commands.json, which can be used for various code completion
+# plugins.
+set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
+
 #-----------------------------------------------------------------------------#
 
 include(Helpers)