mirror of
https://github.com/jkcoxson/idevice.git
synced 2026-03-02 06:26:15 +01:00
Fix building FFI on Linux
This commit is contained in:
@@ -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)
|
||||
|
||||
|
||||
@@ -9,7 +9,6 @@
|
||||
#include <cstdint>
|
||||
#include <optional>
|
||||
#include <string>
|
||||
#include <sys/_types/_u_int8_t.h>
|
||||
#include <vector>
|
||||
|
||||
#ifdef _WIN32
|
||||
|
||||
@@ -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 )
|
||||
|
||||
@@ -5,7 +5,6 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <sys/_types/_u_int64_t.h>
|
||||
|
||||
int main() {
|
||||
// Initialize logger
|
||||
|
||||
Reference in New Issue
Block a user