diff options
| author | Glenn Smith <glenn@vector35.com> | 2024-03-19 17:19:54 -0400 |
|---|---|---|
| committer | Glenn Smith <glenn@vector35.com> | 2024-03-19 17:19:54 -0400 |
| commit | 9524254213477521804542721606710671523772 (patch) | |
| tree | 05dd146c815c711a56b86c8a7d05bca355ac502f /CMakeLists.txt | |
| parent | 8856095011304479986025802863189071553357 (diff) | |
Add CMake option for BN_REF_COUNT_DEBUG
Rather than commenting/uncommenting the #define, now you can just specify this.
Diffstat (limited to 'CMakeLists.txt')
| -rw-r--r-- | CMakeLists.txt | 7 |
1 files changed, 7 insertions, 0 deletions
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) |
