cmake: freebsd fixup

This commit is contained in:
kojin 2021-10-03 16:16:43 -04:00 committed by Kojin
parent e096814697
commit e04c890018
2 changed files with 22 additions and 13 deletions

View File

@ -119,21 +119,25 @@ else()
## Use CheckLib package to find module
include(CheckLib)
if(Linux)
if(UNIX AND NOT APPLE)
check_lib(EGL EGL EGL/egl.h)
check_lib(X11_XCB X11-xcb X11/Xlib-xcb.h)
check_lib(XCB xcb xcb/xcb.h)
check_lib(AIO aio libaio.h)
# There are two udev pkg config files - udev.pc (wrong), libudev.pc (correct)
# When cross compiling, pkg-config will be skipped so we have to look for
# udev (it'll automatically be prefixed with lib). But when not cross
# compiling, we have to look for libudev.pc. Argh. Hence the silliness below.
if(CMAKE_CROSSCOMPILING)
check_lib(LIBUDEV udev libudev.h)
else()
check_lib(LIBUDEV libudev libudev.h)
if(Linux)
check_lib(AIO aio libaio.h)
# There are two udev pkg config files - udev.pc (wrong), libudev.pc (correct)
# When cross compiling, pkg-config will be skipped so we have to look for
# udev (it'll automatically be prefixed with lib). But when not cross
# compiling, we have to look for libudev.pc. Argh. Hence the silliness below.
if(CMAKE_CROSSCOMPILING)
check_lib(LIBUDEV udev libudev.h)
else()
check_lib(LIBUDEV libudev libudev.h)
endif()
endif()
endif()
if(PORTAUDIO_API)
check_lib(PORTAUDIO portaudio portaudio.h pa_linux_alsa.h)
endif()

View File

@ -1427,7 +1427,12 @@ if(Linux)
ALSA::ALSA
)
elseif(UNIX AND NOT APPLE)
target_link_libraries(PCSX2_FLAGS INTERFACE X11::X11)
target_link_libraries(PCSX2_FLAGS INTERFACE
X11::X11
PkgConfig::XCB
PkgConfig::EGL
PkgConfig::X11_XCB
)
endif()
# Windows
@ -1437,8 +1442,8 @@ if(Windows)
${pcsx2WindowsHeaders})
endif()
# MacOSX
if(APPLE)
# MacOSX/BSD
if(UNIX AND NOT Linux)
target_sources(PCSX2 PRIVATE
${pcsx2OSXSources}
${pcsx2LinuxHeaders}