Add a proper option to toggle between tinyglib and glib proper
This commit is contained in:
@@ -17,23 +17,18 @@ 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
|
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)
|
tcp_output.c tcp_subr.c tcp_timer.c udp.c util.c version.c)
|
||||||
|
|
||||||
if (CMAKE_SYSTEM_NAME MATCHES "Windows")
|
if(WIN32)
|
||||||
target_link_libraries(slirp wsock32 iphlpapi)
|
target_link_libraries(slirp wsock32 iphlpapi)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(QT)
|
option(SLIRP_GLIB "Use GLib proper with SLiRP" OFF)
|
||||||
if(UNIX AND NOT APPLE)
|
|
||||||
|
if(SLIRP_GLIB)
|
||||||
find_package(PkgConfig REQUIRED)
|
find_package(PkgConfig REQUIRED)
|
||||||
pkg_check_modules(GLIB_PKG IMPORTED_TARGET glib-2.0)
|
pkg_check_modules(GLIB REQUIRED IMPORTED_TARGET glib-2.0)
|
||||||
if (GLIB_PKG_FOUND)
|
target_link_libraries(slirp PkgConfig::GLIB)
|
||||||
target_compile_definitions(slirp PRIVATE TINYGLIB_USE_GLIB)
|
|
||||||
target_link_libraries(slirp PkgConfig::GLIB_PKG)
|
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()
|
else()
|
||||||
target_sources(slirp PRIVATE tinyglib.c)
|
target_sources(slirp PRIVATE tinyglib.c)
|
||||||
endif()
|
endif()
|
||||||
|
|||||||
Reference in New Issue
Block a user