diff --git a/.gitignore b/.gitignore index 7d569be297..4377ff8977 100644 --- a/.gitignore +++ b/.gitignore @@ -94,3 +94,8 @@ deps/build doc/ /dummy.cpp + +# compile_commands.json - http://clang.llvm.org/docs/JSONCompilationDatabase.html +# generated by CMake + clang - Symlink debug/compile_commands.json (or release) +# to the root of the project for most tooling to work. This ignores the symlink. +/compile_commands.json diff --git a/CMakeLists.txt b/CMakeLists.txt index 02e554a46b..7ff6c1958e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -16,6 +16,10 @@ cmake_policy(SET CMP0046 OLD) cmake_policy(SET CMP0042 NEW) endif() +# Generate a compilation database for use with automated tools like IDE/editor +# plugins. See http://clang.llvm.org/docs/JSONCompilationDatabase.html +set( CMAKE_EXPORT_COMPILE_COMMANDS ON ) + # Determine where additional Turi specific cmake modules are # defined set(DEPS_CMAKE ${CMAKE_SOURCE_DIR}/deps/cmake)