summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorkat <kat@vector35.com>2025-07-28 08:48:20 -0400
committerkat <kat@vector35.com>2025-07-28 08:48:20 -0400
commit0d031494987b6e1f36ebaaf3b0b92c278cd8ca6b (patch)
tree9acdf69b286822eee8c9c71e71b849e2b7301e64 /CMakeLists.txt
parent2f1d09c6b714a9f2664eab0a9dbef79e3cbd8919 (diff)
Define _DEBUG/NDEBUG in api project when doing Debug/RelWithDebInfo builds
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt6
1 files changed, 6 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index d4394590..904fcf4f 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -73,6 +73,12 @@ if(BN_REF_COUNT_DEBUG)
target_compile_definitions(binaryninjaapi PUBLIC BN_REF_COUNT_DEBUG)
endif()
+if(CMAKE_BUILD_TYPE MATCHES Debug OR CMAKE_BUILD_TYPE MATCHES RelWithDebInfo)
+ target_compile_definitions(binaryninjaapi PRIVATE _DEBUG)
+else()
+ target_compile_definitions(binaryninjaapi PRIVATE NDEBUG)
+endif()
+
add_subdirectory(vendor/fmt EXCLUDE_FROM_ALL)
set_target_properties(fmt PROPERTIES POSITION_INDEPENDENT_CODE ON)
target_link_libraries(binaryninjaapi PUBLIC fmt::fmt)