From 2f1150703636b2b06d84bb66853fce7382bf6f29 Mon Sep 17 00:00:00 2001 From: Mark Rowe Date: Thu, 31 Jul 2025 13:28:58 -0700 Subject: Introduce bn::base::function_ref, a non-owning function wrapper inspired by C++26's std::function_ref This is to `std::function` as `std::string_view` is to `std::string`. --- base/CMakeLists.txt | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 base/CMakeLists.txt (limited to 'base/CMakeLists.txt') diff --git a/base/CMakeLists.txt b/base/CMakeLists.txt new file mode 100644 index 00000000..4c0ace90 --- /dev/null +++ b/base/CMakeLists.txt @@ -0,0 +1,24 @@ +cmake_minimum_required(VERSION 3.15 FATAL_ERROR) + +file(GLOB BN_BASE_SOURCES CONFIGURE_DEPENDS *.cpp *.h) + +add_library(binaryninjabase OBJECT ${BN_BASE_SOURCES}) +set_target_properties(binaryninjabase PROPERTIES LINKER_LANGUAGE CXX) + +target_include_directories(binaryninjabase + PUBLIC ${PROJECT_SOURCE_DIR}) + +set_target_properties(binaryninjabase PROPERTIES + CXX_STANDARD 20 + CXX_VISIBILITY_PRESET hidden + CXX_STANDARD_REQUIRED ON + VISIBILITY_INLINES_HIDDEN ON + POSITION_INDEPENDENT_CODE ON) + +if(BN_REF_COUNT_DEBUG) + target_compile_definitions(binaryninjabase PUBLIC BN_REF_COUNT_DEBUG) +endif() + +if(CMAKE_BUILD_TYPE MATCHES Debug OR CMAKE_BUILD_TYPE MATCHES RelWithDebInfo) + target_compile_definitions(binaryninjabase PRIVATE BN_ENABLE_LOG_TRACE) +endif() -- cgit v1.3.1