2021-01-12 18:05:25 +01:00
|
|
|
#
|
2022-11-13 16:37:58 -05:00
|
|
|
# 86Box A hypervisor and IBM PC system emulator that specializes in
|
|
|
|
|
# running old operating systems and software designed for IBM
|
|
|
|
|
# PC systems and compatibles from 1981 through fairly recent
|
|
|
|
|
# system designs based on the PCI bus.
|
2021-01-12 18:05:25 +01:00
|
|
|
#
|
2022-11-13 16:37:58 -05:00
|
|
|
# This file is part of the 86Box distribution.
|
2021-01-12 18:05:25 +01:00
|
|
|
#
|
2022-11-13 16:37:58 -05:00
|
|
|
# CMake build script.
|
2021-01-12 18:05:25 +01:00
|
|
|
#
|
2022-11-13 16:37:58 -05:00
|
|
|
# Authors: David Hrdlička, <hrdlickadavid@outlook.com>
|
2021-01-12 18:05:25 +01:00
|
|
|
#
|
2023-01-06 15:36:29 -05:00
|
|
|
# Copyright 2020-2021 David Hrdlička.
|
2021-01-12 18:05:25 +01:00
|
|
|
#
|
2023-05-04 21:12:02 +02:00
|
|
|
set(net_sources)
|
|
|
|
|
list(APPEND net_sources network.c net_pcap.c net_slirp.c net_dp8390.c net_3c501.c
|
2023-07-29 16:24:35 +06:00
|
|
|
net_3c503.c net_ne2000.c net_pcnet.c net_wd8003.c net_plip.c net_event.c net_null.c
|
|
|
|
|
net_eeprom_nmc93cxx.c net_tulip.c)
|
2021-01-12 18:22:40 +01:00
|
|
|
|
2023-07-22 17:27:51 -03:00
|
|
|
find_package(PkgConfig REQUIRED)
|
|
|
|
|
pkg_check_modules(SLIRP REQUIRED IMPORTED_TARGET slirp)
|
|
|
|
|
target_link_libraries(86Box PkgConfig::SLIRP)
|
2022-01-13 03:01:15 +01:00
|
|
|
|
2023-07-22 17:27:51 -03:00
|
|
|
if(WIN32)
|
|
|
|
|
target_link_libraries(PkgConfig::SLIRP INTERFACE wsock32 ws2_32 iphlpapi iconv)
|
2022-02-18 21:42:05 +01:00
|
|
|
endif()
|
2022-03-11 12:03:54 +06:00
|
|
|
|
|
|
|
|
if (HAIKU)
|
|
|
|
|
target_link_libraries(86Box network)
|
|
|
|
|
endif()
|
2022-08-21 19:48:00 +02:00
|
|
|
|
|
|
|
|
if(WIN32)
|
|
|
|
|
target_link_libraries(86Box ws2_32)
|
|
|
|
|
endif()
|
2023-05-04 21:12:02 +02:00
|
|
|
|
|
|
|
|
if (UNIX)
|
|
|
|
|
find_path(HAS_VDE "libvdeplug.h" PATHS ${VDE_INCLUDE_DIR} "/usr/include /usr/local/include" "/opt/homebrew/include" )
|
|
|
|
|
if(HAS_VDE)
|
2023-06-09 10:37:05 -04:00
|
|
|
find_library(VDE_LIB vdeplug)
|
|
|
|
|
if (NOT VDE_LIB)
|
|
|
|
|
message(WARNING "Could not find VDE. The library will not be bundled and any related features will be disabled.")
|
|
|
|
|
else()
|
|
|
|
|
add_compile_definitions(HAS_VDE)
|
|
|
|
|
list(APPEND net_sources net_vde.c)
|
|
|
|
|
endif()
|
2023-05-04 21:12:02 +02:00
|
|
|
endif()
|
|
|
|
|
endif()
|
|
|
|
|
|
|
|
|
|
add_library(net OBJECT ${net_sources})
|