diff options
author | Benjamin Kramer <benny.kra@googlemail.com> | 2015-12-16 18:17:45 +0000 |
---|---|---|
committer | Benjamin Kramer <benny.kra@googlemail.com> | 2015-12-16 18:17:45 +0000 |
commit | dd45002d97901e1e6affbdba876d28ea30d4aab1 (patch) | |
tree | a44f73eaaeaf85b2dd549ae3386bf45719463db9 /CMakeLists.txt | |
parent | c1fb525cc504cf19cd1bdaac07975191f47e9875 (diff) |
Generate a clang CompilationDatabase when running CMake
This generates a compile_commands.json file, which tells tools like
YouCompleteMe and clang_complete exactly how to build each source file.
Patch by Justin Lebar!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@255789 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index c4ff8f3cd28b..3d2093fde634 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -86,6 +86,10 @@ set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules" ) +# Generate a CompilationDatabase (compile_commands.json file) for our build, +# for use by clang_complete, YouCompleteMe, etc. +set(CMAKE_EXPORT_COMPILE_COMMANDS 1) + option(LLVM_INSTALL_UTILS "Include utility binaries in the 'install' target." OFF) option(LLVM_INSTALL_TOOLCHAIN_ONLY "Only include toolchain files in the 'install' target." OFF) |