From 751afe2fdb64f12145696acf005af593ba60035c Mon Sep 17 00:00:00 2001 From: cgtinker Date: Fri, 7 Apr 2023 15:26:56 +0200 Subject: [PATCH] compiler_commands.json as config option --- CMakeLists.txt | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 43855083b0c..ed67a05896c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -203,6 +203,8 @@ option(WITH_PYTHON_SAFETY "Enable internal API error checking to track invalid d mark_as_advanced(WITH_PYTHON_SAFETY) option(WITH_PYTHON_MODULE "Enable building as a python module which runs without a user interface, like running regular blender in background mode (experimental, only enable for development), installs to PYTHON_SITE_PACKAGES (or CMAKE_INSTALL_PREFIX if WITH_INSTALL_PORTABLE is enabled)." OFF) +option(WITH_COMPILER_COMMANDS "Include compiler_commands.json" OFF) + option(WITH_BUILDINFO "Include extra build details (only disable for development & faster builds)" ON) set(BUILDINFO_OVERRIDE_DATE "" CACHE STRING "Use instead of the current date for reproducible builds (empty string disables this option)") set(BUILDINFO_OVERRIDE_TIME "" CACHE STRING "Use instead of the current time for reproducible builds (empty string disables this option)") @@ -923,6 +925,10 @@ if(WITH_GHOST_SDL OR WITH_HEADLESS) set(WITH_XR_OPENXR OFF) endif() +if(WITH_COMPILER_COMMANDS) + set(CMAKE_EXPORT_COMPILE_COMMANDS ON) +endif() + if(WITH_BUILDINFO) find_package(Git) set_and_warn_library_found("Git" GIT_FOUND WITH_BUILDINFO) @@ -1910,6 +1916,7 @@ if(FIRST_RUN) info_cfg_text("Compiler Options:") info_cfg_option(WITH_BUILDINFO) info_cfg_option(WITH_OPENMP) + info_cfg_option(WITH_COMPILER_COMMANDS) info_cfg_text("System Options:") info_cfg_option(WITH_INSTALL_PORTABLE) -- 2.30.2