Skip to content

Commit

Permalink
Add CMake option for BN_REF_COUNT_DEBUG
Browse files Browse the repository at this point in the history
Rather than commenting/uncommenting the #define, now you can just specify this.
  • Loading branch information
CouleeApps committed Mar 19, 2024
1 parent 8856095 commit 9524254
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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\")")
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 9524254

Please sign in to comment.