From e04c890018926a2e622516f129809a6aed870077 Mon Sep 17 00:00:00 2001 From: kojin Date: Sun, 3 Oct 2021 16:16:43 -0400 Subject: [PATCH] cmake: freebsd fixup --- cmake/SearchForStuff.cmake | 24 ++++++++++++++---------- pcsx2/CMakeLists.txt | 11 ++++++++--- 2 files changed, 22 insertions(+), 13 deletions(-) diff --git a/cmake/SearchForStuff.cmake b/cmake/SearchForStuff.cmake index 798ea8ed44..90e570424e 100644 --- a/cmake/SearchForStuff.cmake +++ b/cmake/SearchForStuff.cmake @@ -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() diff --git a/pcsx2/CMakeLists.txt b/pcsx2/CMakeLists.txt index 350e3af0c5..e26cc4b809 100644 --- a/pcsx2/CMakeLists.txt +++ b/pcsx2/CMakeLists.txt @@ -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}