From 726c49b40797cc1a8a355ae98e60ca83bad51bbb Mon Sep 17 00:00:00 2001 From: slayercio Date: Tue, 18 Nov 2025 22:03:04 +0100 Subject: [PATCH] fix: add examples to cmake --- CMakeLists.txt | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 2b7081d..ce58489 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -20,4 +20,22 @@ target_include_directories(native_invoker_lib set(BLACKBASE_BUILD_TESTS OFF CACHE BOOL "Disable building tests for blackbase") add_subdirectory(vendor/blackbase) -target_link_libraries(native_invoker_lib PUBLIC blackbase) \ No newline at end of file +target_link_libraries(native_invoker_lib PUBLIC blackbase) + +file(GLOB NATIVE_INVOKER_EXAMPLES + examples/*.cpp +) + +foreach(EXAMPLE_SOURCE ${NATIVE_INVOKER_EXAMPLES}) + get_filename_component(EXAMPLE_NAME ${EXAMPLE_SOURCE} NAME_WE) + add_library(${EXAMPLE_NAME} SHARED ${EXAMPLE_SOURCE}) + target_include_directories(${EXAMPLE_NAME} + PUBLIC + include + ) + + target_compile_definitions(${EXAMPLE_NAME} + PRIVATE + FXN_IMPORTS + ) +endforeach() \ No newline at end of file