cmake_minimum_required(VERSION 3.27) project(chuniio_brokenithm) set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/") include_directories("${CMAKE_SOURCE_DIR}/include/") set(CMAKE_CXX_STANDARD 17) set(CMAKE_C_COMPILER "gcc") set(CMAKE_CXX_COMPILER "g++") include(CheckIPOSupported) check_ipo_supported(RESULT supported OUTPUT error) if (supported) message(STATUS "IPO / LTO enabled") set(CMAKE_INTERPROCEDURAL_OPTIMIZATION TRUE) else() message(STATUS "IPO / LTO not supported: <${error}>") endif() link_directories(src) add_library(chuniio_brokenithm SHARED src/chuniio.c src/chuniio.h src/config.c src/config.h src/socket.h src/struct.h src/util/dprintf.c src/util/dprintf.h) set_target_properties(chuniio_brokenithm PROPERTIES PREFIX "") set_target_properties(chuniio_brokenithm PROPERTIES COMPILE_FLAGS "-m32" LINK_FLAGS "-m32 -Wl,--allow-multiple-definition") target_link_libraries(chuniio_brokenithm "-static-libgcc -Wl,-Bstatic -limobiledevice-1.0 -lssl -lcrypto -lplist-2.0 -lusbmuxd-2.0 -lpthread -Wl,-Bdynamic -lws2_32 -lcrypt32 -liphlpapi")