Fix building FFI on Linux

This commit is contained in:
Jackson Coxson
2025-07-22 14:17:46 -06:00
parent b5f47ff23c
commit 8a1fbbf740
4 changed files with 9 additions and 2 deletions

View File

@@ -18,6 +18,8 @@ set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wpedantic")
find_package(PkgConfig REQUIRED)
# Find all C++ example files
file(GLOB EXAMPLE_SOURCES ${EXAMPLES_DIR}/*.cpp)

View File

@@ -9,7 +9,6 @@
#include <cstdint>
#include <optional>
#include <string>
#include <sys/_types/_u_int8_t.h>
#include <vector>
#ifdef _WIN32

View File

@@ -12,6 +12,8 @@ set(EXAMPLES_DIR ${CMAKE_SOURCE_DIR}/../examples)
# Find all C example files
file(GLOB EXAMPLE_SOURCES ${EXAMPLES_DIR}/*.c)
find_package(PkgConfig REQUIRED)
# Create an executable for each example file
foreach(EXAMPLE_FILE ${EXAMPLE_SOURCES})
# Extract the filename without the path
@@ -26,6 +28,11 @@ foreach(EXAMPLE_FILE ${EXAMPLE_SOURCES})
# Link the static Rust library
target_link_libraries(${EXAMPLE_NAME} PRIVATE ${STATIC_LIB})
if(UNIX AND NOT APPLE)
target_link_libraries(${EXAMPLE_NAME} PRIVATE m)
endif()
# libplist
if( APPLE )

View File

@@ -5,7 +5,6 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/_types/_u_int64_t.h>
int main() {
// Initialize logger