diff options
author | Daan De Meyer <daan.j.demeyer@gmail.com> | 2019-10-12 16:49:04 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2019-10-18 18:37:33 (GMT) |
commit | 8065a686ddcb54b10fd6758eca24280f3e68926b (patch) | |
tree | 26160936788f23291802c1639be94a9b4a9cd463 /Modules/CMakeGenericSystem.cmake | |
parent | 493c4e781a35a92c5c912b22493b84de750b1fe1 (diff) | |
download | CMake-8065a686ddcb54b10fd6758eca24280f3e68926b.zip CMake-8065a686ddcb54b10fd6758eca24280f3e68926b.tar.gz CMake-8065a686ddcb54b10fd6758eca24280f3e68926b.tar.bz2 |
Initialize CMAKE_EXPORT_COMPILE_COMMANDS from envvar of the same name
Fixes: #18386
Diffstat (limited to 'Modules/CMakeGenericSystem.cmake')
-rw-r--r-- | Modules/CMakeGenericSystem.cmake | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Modules/CMakeGenericSystem.cmake b/Modules/CMakeGenericSystem.cmake index 77d8cfd..7efe5c4 100644 --- a/Modules/CMakeGenericSystem.cmake +++ b/Modules/CMakeGenericSystem.cmake @@ -51,16 +51,16 @@ if(CMAKE_GENERATOR MATCHES "Make") set_property(GLOBAL PROPERTY TARGET_MESSAGES ${CMAKE_TARGET_MESSAGES}) endif() if(CMAKE_GENERATOR MATCHES "Unix Makefiles") - set(CMAKE_EXPORT_COMPILE_COMMANDS OFF CACHE BOOL - "Enable/Disable output of compile commands during generation." + 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") - set(CMAKE_EXPORT_COMPILE_COMMANDS OFF CACHE BOOL - "Enable/Disable output of compile commands during generation." + 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() |