aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/CMakeLists.txt
diff options
context:
space:
mode:
authorbfredl <bjorn.linse@gmail.com>2023-03-04 17:18:32 +0100
committerGitHub <noreply@github.com>2023-03-04 17:18:32 +0100
commitbc26f23e5ae49f54b4fbd18f692f300254e454eb (patch)
treec5bed8b8eb3aaf261197a9713eef8b8cc3e13e35 /src/nvim/CMakeLists.txt
parentdde5ce46b2e3e77efc27394b946ef49ce565cd95 (diff)
parent2ba224e1526681c1a0b1b2b095b1ef2b0874db48 (diff)
downloadrneovim-bc26f23e5ae49f54b4fbd18f692f300254e454eb.tar.gz
rneovim-bc26f23e5ae49f54b4fbd18f692f300254e454eb.tar.bz2
rneovim-bc26f23e5ae49f54b4fbd18f692f300254e454eb.zip
Merge pull request #22415 from bfredl/log_debug
refactor(log): reduce compile time LOG_LEVEL granularity
Diffstat (limited to 'src/nvim/CMakeLists.txt')
-rwxr-xr-xsrc/nvim/CMakeLists.txt19
1 files changed, 8 insertions, 11 deletions
diff --git a/src/nvim/CMakeLists.txt b/src/nvim/CMakeLists.txt
index 10f44c428c..61530f5a7b 100755
--- a/src/nvim/CMakeLists.txt
+++ b/src/nvim/CMakeLists.txt
@@ -373,19 +373,16 @@ else()
${EXTERNAL_SOURCES} PROPERTIES COMPILE_FLAGS "${COMPILE_FLAGS} -Wno-conversion -Wno-missing-noreturn -Wno-missing-format-attribute -Wno-double-promotion -Wno-strict-prototypes -Wno-misleading-indentation")
endif()
-# Log level (MIN_LOG_LEVEL in log.h)
+# Log level (NVIM_LOG_DEBUG in log.h)
if($ENV{CI})
- set(MIN_LOG_LEVEL 3)
-endif()
-if("${MIN_LOG_LEVEL}" MATCHES "^$")
- # Minimize logging for release-type builds.
- target_compile_definitions(main_lib INTERFACE MIN_LOG_LEVEL=$<IF:$<CONFIG:Debug>,1,3>)
+ # Don't debug log on CI, it gets too verbose in the main build log.
+ # TODO(bfredl): debug log level also exposes some errors with EXITFREE in ASAN build.
+ set(LOG_DEBUG FALSE)
+elseif(LOG_DEBUG)
+ target_compile_definitions(nvim PRIVATE NVIM_LOG_DEBUG)
else()
- if(NOT MIN_LOG_LEVEL MATCHES "^[0-3]$")
- message(FATAL_ERROR "invalid MIN_LOG_LEVEL: " ${MIN_LOG_LEVEL})
- endif()
- message(STATUS "MIN_LOG_LEVEL=${MIN_LOG_LEVEL}")
- target_compile_definitions(main_lib INTERFACE MIN_LOG_LEVEL=${MIN_LOG_LEVEL})
+ # Minimize logging for release-type builds.
+ target_compile_definitions(nvim PRIVATE $<$<CONFIG:Debug>:NVIM_LOG_DEBUG>)
endif()
if(CLANG_ASAN_UBSAN OR CLANG_MSAN OR CLANG_TSAN)