From 70bf63e2ea81504ad46c927c521842ea3d7c562c Mon Sep 17 00:00:00 2001 From: samsonium Date: Wed, 28 Oct 2026 00:31:09 +0300 Subject: [PATCH] feat: add `libffi` cmake dependency --- CMakeLists.txt | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index e388003..c46da83 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -3,6 +3,7 @@ project(fz-lang LANGUAGES C) set(CMAKE_EXPORT_COMPILE_COMMANDS ON) +set(BUILD_SHARED_LIBS OFF) add_compile_options(-Wall -Wextra -Werror=implicit-function-declaration) if (CMAKE_BUILD_TYPE STREQUAL "Debug") @@ -11,6 +12,13 @@ if (CMAKE_BUILD_TYPE STREQUAL "Debug") endif() include_directories(include) +include(FetchContent) + +FetchContent_Declare(ffi + GIT_REPOSITORY "https://git.samsonium.dev/samsonium/libffi.git" + GIT_TAG "main" +) +FetchContent_MakeAvailable(ffi) # Compiler add_executable(fzc @@ -56,6 +64,8 @@ add_executable(fz src/vm/fzl_vm_debug.c src/vm/main.c) +target_link_libraries(fz PRIVATE ffi_static dl) + # # ========== Tests ========== #