generate compiler_commands.json file as make config option #1

Open
Denys Hsu wants to merge 1 commits from make-config into main

When changing the target branch, be careful to rebase the branch in your fork to match. See documentation.

View File

@ -203,6 +203,8 @@ option(WITH_PYTHON_SAFETY "Enable internal API error checking to track invalid d
mark_as_advanced(WITH_PYTHON_SAFETY) 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_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) 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_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)") 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) set(WITH_XR_OPENXR OFF)
endif() endif()
if(WITH_COMPILER_COMMANDS)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
endif()
if(WITH_BUILDINFO) if(WITH_BUILDINFO)
find_package(Git) find_package(Git)
set_and_warn_library_found("Git" GIT_FOUND WITH_BUILDINFO) set_and_warn_library_found("Git" GIT_FOUND WITH_BUILDINFO)
@ -1910,6 +1916,7 @@ if(FIRST_RUN)
info_cfg_text("Compiler Options:") info_cfg_text("Compiler Options:")
info_cfg_option(WITH_BUILDINFO) info_cfg_option(WITH_BUILDINFO)
info_cfg_option(WITH_OPENMP) info_cfg_option(WITH_OPENMP)
info_cfg_option(WITH_COMPILER_COMMANDS)
info_cfg_text("System Options:") info_cfg_text("System Options:")
info_cfg_option(WITH_INSTALL_PORTABLE) info_cfg_option(WITH_INSTALL_PORTABLE)