From ac3e7cb724d851b018c52687e96368b0d5161008 Mon Sep 17 00:00:00 2001 From: John Sanpe Date: Sun, 9 Mar 2025 21:08:12 +0800 Subject: [PATCH] fixup refcount: do not compile refcount-debug when debug disabled Signed-off-by: John Sanpe --- src/build.cmake | 8 +++++++- src/{refcount.c => refcount-debug.c} | 0 2 files changed, 7 insertions(+), 1 deletion(-) rename src/{refcount.c => refcount-debug.c} (100%) diff --git a/src/build.cmake b/src/build.cmake index f2367d8a..e0f357ae 100644 --- a/src/build.cmake +++ b/src/build.cmake @@ -39,7 +39,6 @@ set(BFDEV_SOURCE ${CMAKE_CURRENT_LIST_DIR}/radix.c ${CMAKE_CURRENT_LIST_DIR}/ratelimit.c ${CMAKE_CURRENT_LIST_DIR}/rbtree.c - ${CMAKE_CURRENT_LIST_DIR}/refcount.c ${CMAKE_CURRENT_LIST_DIR}/respool.c ${CMAKE_CURRENT_LIST_DIR}/ringbuf.c ${CMAKE_CURRENT_LIST_DIR}/scnprintf.c @@ -85,6 +84,13 @@ if(BFDEV_DEBUG_HEAP) ) endif() +if(BFDEV_DEBUG_REFCNT) + set(BFDEV_SOURCE + ${BFDEV_SOURCE} + ${CMAKE_CURRENT_LIST_DIR}/refcount-debug.c + ) +endif() + include(${CMAKE_CURRENT_LIST_DIR}/cache/build.cmake) include(${CMAKE_CURRENT_LIST_DIR}/crypto/build.cmake) include(${CMAKE_CURRENT_LIST_DIR}/libc/build.cmake) diff --git a/src/refcount.c b/src/refcount-debug.c similarity index 100% rename from src/refcount.c rename to src/refcount-debug.c