Add options to discover munt and slirp locally

This commit is contained in:
David Hrdlička
2022-01-13 03:01:15 +01:00
parent 7d7826d7a5
commit 3305063f55
3 changed files with 23 additions and 5 deletions

View File

@@ -16,5 +16,14 @@
add_library(net OBJECT network.c net_pcap.c net_slirp.c net_dp8390.c net_3c503.c
net_ne2000.c net_pcnet.c net_wd8003.c net_plip.c)
add_subdirectory(slirp)
target_link_libraries(86Box slirp)
option(SLIRP_EXTERNAL "Link against the system-provided libslirp library" OFF)
mark_as_advanced(SLIRP_EXTERNAL)
if(SLIRP_EXTERNAL)
find_package(PkgConfig REQUIRED)
pkg_check_modules(SLIRP REQUIRED IMPORTED_TARGET slirp)
target_link_libraries(86Box PkgConfig::SLIRP)
else()
add_subdirectory(slirp)
target_link_libraries(86Box slirp)
endif()

View File

@@ -33,8 +33,17 @@ if(MUNT)
target_compile_definitions(snd PRIVATE USE_MUNT)
target_sources(snd PRIVATE midi_mt32.c)
add_subdirectory(munt)
target_link_libraries(86Box mt32emu)
option(MUNT_EXTERNAL "Link against the system-provided MUNT library" OFF)
mark_as_advanced(MUNT_EXTERNAL)
if(MUNT_EXTERNAL)
find_package(PkgConfig REQUIRED)
pkg_check_modules(MT32EMU REQUIRED IMPORTED_TARGET mt32emu)
target_link_libraries(86Box PkgConfig::MT32EMU)
else()
add_subdirectory(munt)
target_link_libraries(86Box mt32emu)
endif()
endif()
if(PAS16)

View File

@@ -54,4 +54,4 @@ else()
endif()
target_link_libraries(86Box advapi32 comctl32 comdlg32 gdi32 shell32 iphlpapi
dxguid imm32 hid setupapi uxtheme version winmm psapi)
dxguid imm32 hid setupapi uxtheme version winmm psapi ws2_32)