diff options
author | Brad King <brad.king@kitware.com> | 2020-05-12 11:48:17 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2020-05-12 12:08:20 (GMT) |
commit | fe19df49d48680cbfd8e1023d4a93b39f12d4b64 (patch) | |
tree | f976accb2ab186b588431acf93c93c0c0626d642 /Modules/CMakeGenericSystem.cmake | |
parent | 4dc95526868d903c7f9e9505001cb5dbeec259c0 (diff) | |
download | CMake-fe19df49d48680cbfd8e1023d4a93b39f12d4b64.zip CMake-fe19df49d48680cbfd8e1023d4a93b39f12d4b64.tar.gz CMake-fe19df49d48680cbfd8e1023d4a93b39f12d4b64.tar.bz2 |
Initialize CMAKE_EXPORT_COMPILE_COMMANDS only if not set already
Also de-duplicate its initialization code.
Fixes: #16588
Diffstat (limited to 'Modules/CMakeGenericSystem.cmake')
-rw-r--r-- | Modules/CMakeGenericSystem.cmake | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/Modules/CMakeGenericSystem.cmake b/Modules/CMakeGenericSystem.cmake index f539b46..000fba1 100644 --- a/Modules/CMakeGenericSystem.cmake +++ b/Modules/CMakeGenericSystem.cmake @@ -50,15 +50,9 @@ if(CMAKE_GENERATOR MATCHES "Make") if(DEFINED CMAKE_TARGET_MESSAGES) set_property(GLOBAL PROPERTY TARGET_MESSAGES ${CMAKE_TARGET_MESSAGES}) endif() - if(CMAKE_GENERATOR MATCHES "Unix Makefiles") - set(CMAKE_EXPORT_COMPILE_COMMANDS "$ENV{CMAKE_EXPORT_COMPILE_COMMANDS}" - CACHE BOOL "Enable/Disable output of compile commands during generation." - ) - mark_as_advanced(CMAKE_EXPORT_COMPILE_COMMANDS) - endif() endif() -if(CMAKE_GENERATOR MATCHES "Ninja") +if(NOT DEFINED CMAKE_EXPORT_COMPILE_COMMANDS AND CMAKE_GENERATOR MATCHES "Ninja|Unix Makefiles") set(CMAKE_EXPORT_COMPILE_COMMANDS "$ENV{CMAKE_EXPORT_COMPILE_COMMANDS}" CACHE BOOL "Enable/Disable output of compile commands during generation." ) |