From 9524254213477521804542721606710671523772 Mon Sep 17 00:00:00 2001 From: Glenn Smith Date: Tue, 19 Mar 2024 17:19:54 -0400 Subject: Add CMake option for BN_REF_COUNT_DEBUG Rather than commenting/uncommenting the #define, now you can just specify this. --- CMakeLists.txt | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt index 2c543f85..57ed627e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -5,6 +5,9 @@ list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake") option(BN_API_BUILD_EXAMPLES "Builds example plugins" OFF) +option(BN_REF_COUNT_DEBUG "Add extra debugging checks for RefCountObject leaks" OFF) +mark_as_advanced(BN_REF_COUNT_DEBUG) + if(NOT CMAKE_SIZEOF_VOID_P EQUAL 8) if (MSVC) message(FATAL_ERROR "Binary Ninja is 64-bit only (try -G \"${CMAKE_GENERATOR} Win64\")") @@ -35,6 +38,10 @@ target_link_libraries(binaryninjaapi PUBLIC ${BinaryNinjaCore_LIBRARIES}) target_link_directories(binaryninjaapi PUBLIC ${BinaryNinjaCore_LIBRARY_DIRS}) target_compile_definitions(binaryninjaapi PUBLIC ${BinaryNinjaCore_DEFINITIONS}) +if(BN_REF_COUNT_DEBUG) + target_compile_definitions(binaryninjaapi PUBLIC BN_REF_COUNT_DEBUG) +endif() + add_subdirectory(vendor/fmt EXCLUDE_FROM_ALL) set_target_properties(fmt PROPERTIES POSITION_INDEPENDENT_CODE ON) target_link_libraries(binaryninjaapi PUBLIC fmt::fmt) -- cgit v1.3.1