diff --git a/cpp/examples/CMakeLists.txt b/cpp/examples/CMakeLists.txt index 6e78a4f..5ed223c 100644 --- a/cpp/examples/CMakeLists.txt +++ b/cpp/examples/CMakeLists.txt @@ -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) diff --git a/cpp/include/usbmuxd.hpp b/cpp/include/usbmuxd.hpp index 8d9f3d8..07b0889 100644 --- a/cpp/include/usbmuxd.hpp +++ b/cpp/include/usbmuxd.hpp @@ -9,7 +9,6 @@ #include #include #include -#include #include #ifdef _WIN32 diff --git a/ffi/examples/CMakeLists.txt b/ffi/examples/CMakeLists.txt index 6dbf217..3849009 100644 --- a/ffi/examples/CMakeLists.txt +++ b/ffi/examples/CMakeLists.txt @@ -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 ) diff --git a/ffi/examples/heartbeat.c b/ffi/examples/heartbeat.c index bda431b..7f71d3a 100644 --- a/ffi/examples/heartbeat.c +++ b/ffi/examples/heartbeat.c @@ -5,7 +5,6 @@ #include #include #include -#include int main() { // Initialize logger