use real glib when compiling for Qt on Unix platforms
This commit is contained in:
@@ -13,12 +13,28 @@
|
||||
# Copyright 2020,2021 David Hrdlička.
|
||||
#
|
||||
|
||||
add_library(slirp STATIC tinyglib.c arp_table.c bootp.c cksum.c dnssearch.c if.c ip_icmp.c
|
||||
ip_input.c ip_output.c mbuf.c misc.c sbuf.c slirp.c socket.c tcp_input.c
|
||||
tcp_output.c tcp_subr.c tcp_timer.c udp.c util.c version.c)
|
||||
add_library(slirp STATIC arp_table.c bootp.c cksum.c dnssearch.c if.c ip_icmp.c
|
||||
ip_input.c ip_output.c mbuf.c misc.c sbuf.c slirp.c socket.c tcp_input.c
|
||||
tcp_output.c tcp_subr.c tcp_timer.c udp.c util.c version.c)
|
||||
|
||||
#target_link_libraries(slirp wsock32 iphlpapi)
|
||||
#target_link_libraries(slirp)
|
||||
if (CMAKE_SYSTEM_NAME MATCHES "Windows")
|
||||
target_link_libraries(slirp wsock32 iphlpapi)
|
||||
target_link_libraries(slirp wsock32 iphlpapi)
|
||||
endif()
|
||||
|
||||
if(QT)
|
||||
if(UNIX AND NOT APPLE)
|
||||
find_package(PkgConfig REQUIRED)
|
||||
pkg_check_modules(GLIB_PKG glib-2.0)
|
||||
if (GLIB_PKG_FOUND)
|
||||
include_directories(${GLIB_PKG_INCLUDE_DIRS})
|
||||
target_link_libraries(slirp glib-2.0)
|
||||
target_compile_definitions(slirp PRIVATE TINYGLIB_USE_GLIB)
|
||||
else()
|
||||
message(ERROR "GLib development headers are required when compiling with Qt on Unix")
|
||||
endif()
|
||||
else()
|
||||
target_sources(slirp PRIVATE tinyglib.c)
|
||||
endif()
|
||||
else()
|
||||
target_sources(slirp PRIVATE tinyglib.c)
|
||||
endif()
|
||||
|
Reference in New Issue
Block a user