check if libserial exists for unsupported libserial OS
This commit is contained in:
@@ -60,8 +60,10 @@ extern const device_t ymf289b_ymfm_device;
|
||||
extern const device_t ymf278b_ymfm_device;
|
||||
|
||||
extern const device_t esfm_esfmu_device;
|
||||
|
||||
#ifdef USE_LIBSERIALPORT
|
||||
extern const device_t ym_opl2board_device;
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
#endif /*SOUND_OPL_H*/
|
||||
|
||||
@@ -209,8 +209,10 @@ extern const device_t tndy_device;
|
||||
extern const device_t wss_device;
|
||||
extern const device_t ncr_business_audio_device;
|
||||
|
||||
#ifdef USE_LIBSERIALPORT
|
||||
/* External Audio device OPL2Board (Host Connected hardware)*/
|
||||
extern const device_t opl2board_device;
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -31,8 +31,6 @@ add_library(snd OBJECT
|
||||
snd_ps1.c
|
||||
snd_adlib.c
|
||||
snd_adlibgold.c
|
||||
snd_opl2board.c
|
||||
snd_opl_opl2board.cpp
|
||||
snd_ad1848.c
|
||||
snd_audiopci.c
|
||||
snd_azt2316a.c
|
||||
@@ -172,20 +170,28 @@ if(OPL4ML)
|
||||
target_compile_definitions(snd PRIVATE USE_OPL4ML)
|
||||
target_sources(snd PRIVATE midi_opl4.c midi_opl4_yrw801.c)
|
||||
endif()
|
||||
|
||||
find_package(PkgConfig REQUIRED)
|
||||
pkg_check_modules(SERIALPORT REQUIRED libserialport)
|
||||
if(APPLE)
|
||||
include_directories(${LIBSERIALPORT_ROOT}/include)
|
||||
target_link_libraries(86Box ${LIBSERIALPORT_ROOT}/lib/libserialport.dylib)
|
||||
elseif(WIN32)
|
||||
include_directories(${SERIALPORT_INCLUDE_DIRS})
|
||||
target_link_libraries(86Box ${SERIALPORT_LIBRARIES} SetupAPI)
|
||||
else()
|
||||
include_directories(${SERIALPORT_INCLUDE_DIRS})
|
||||
target_link_libraries(86Box ${SERIALPORT_LIBRARIES})
|
||||
endif()
|
||||
|
||||
find_package(PkgConfig )
|
||||
pkg_check_modules(SERIALPORT libserialport)
|
||||
|
||||
if(SERIALPORT_FOUND OR DEFINED LIBSERIALPORT_ROOT)
|
||||
add_compile_definitions(USE_LIBSERIALPORT=1)
|
||||
|
||||
if(APPLE)
|
||||
include_directories(${LIBSERIALPORT_ROOT}/include)
|
||||
target_link_libraries(86Box ${LIBSERIALPORT_ROOT}/lib/libserialport.dylib)
|
||||
elseif(WIN32)
|
||||
include_directories(${SERIALPORT_INCLUDE_DIRS})
|
||||
target_link_libraries(86Box ${SERIALPORT_LIBRARIES} SetupAPI)
|
||||
else()
|
||||
include_directories(${SERIALPORT_INCLUDE_DIRS})
|
||||
target_link_libraries(86Box ${SERIALPORT_LIBRARIES})
|
||||
endif()
|
||||
target_sources(snd PRIVATE
|
||||
snd_opl2board.c
|
||||
snd_opl_opl2board.cpp
|
||||
)
|
||||
endif()
|
||||
|
||||
add_subdirectory(resid-fp)
|
||||
target_link_libraries(86Box resid-fp)
|
||||
|
||||
@@ -58,11 +58,12 @@ fm_driver_get(int chip_id, fm_drv_t *drv)
|
||||
drv->priv = device_add_inst(&ymf262_ymfm_device, fm_dev_inst[fm_driver][chip_id]++);
|
||||
}
|
||||
break;
|
||||
|
||||
#ifdef USE_LIBSERIALPORT
|
||||
case FM_OPL2BOARD:
|
||||
*drv = ymfm_opl2board_drv;
|
||||
drv->priv = device_add_inst(&ym_opl2board_device, fm_dev_inst[fm_driver][chip_id]++);
|
||||
break;
|
||||
#endif
|
||||
case FM_YMF289B:
|
||||
*drv = ymfm_drv;
|
||||
drv->priv = device_add_inst(&ymf289b_ymfm_device, fm_dev_inst[fm_driver][chip_id]++);
|
||||
|
||||
@@ -153,7 +153,9 @@ static const SOUND_CARD sound_cards[] = {
|
||||
{ &ct5880_device },
|
||||
{ &ad1881_device },
|
||||
{ &cs4297a_device },
|
||||
#ifdef USE_LIBSERIALPORT /*The following devices required LIBSERIALPORT*/
|
||||
{ &opl2board_device },
|
||||
#endif
|
||||
{ NULL }
|
||||
// clang-format on
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user