summaryrefslogtreecommitdiffstats
path: root/cmake
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@qt.io>2019-05-26 16:55:15 +0200
committerSimon Hausmann <simon.hausmann@qt.io>2019-05-27 18:21:00 +0000
commitf96778dee27f10e84865c4b0a32ef333287c5fe7 (patch)
tree6e08d228f0c8a2d715255fb784640dd38c956546 /cmake
parentcbb143e9f1396c8180401c4f8a5b1fe579902559 (diff)
Enable export of compile commands database
For developer builds, enable the compile commands database by default. This allows Qt developers to use tools that utilize these (such as clang-tidy, etc.) without any extra setup. Change-Id: I79d70ef7dbe7c59864e93593c75f9ff6cd67c2ce Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> Reviewed-by: Qt CMake Build Bot
Diffstat (limited to 'cmake')
-rw-r--r--cmake/QtSetup.cmake5
1 files changed, 5 insertions, 0 deletions
diff --git a/cmake/QtSetup.cmake b/cmake/QtSetup.cmake
index 3b02633ed7..769e17dfb8 100644
--- a/cmake/QtSetup.cmake
+++ b/cmake/QtSetup.cmake
@@ -35,6 +35,11 @@ set(CMAKE_CXX_VISIBILITY_PRESET hidden)
set(CMAKE_VISIBILITY_INLINES_HIDDEN 1)
if(FEATURE_developer_build)
+ if(DEFINED QT_CMAKE_EXPORT_COMPILE_COMMANDS)
+ set(CMAKE_EXPORT_COMPILE_COMMANDS ${QT_CMAKE_EXPORT_COMPILE_COMMANDS})
+ else()
+ set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
+ endif()
set(QT_WILL_INSTALL OFF)
# Handle non-prefix builds by setting the cmake install prefix to the project binary dir.
if(PROJECT_NAME STREQUAL "QtBase")