Created attachment 226141 [details] Do not use pkgconf to find libusb for FreeBSD CMake fails to find libusb when pkgconf exists. ... -- Found PkgConfig: /usr/local/bin/pkg-config (found version "1.7.4") CMake Warning at CMakeLists.txt:440 (message): libusb not found, falling back to externals ... CMake Error at externals/libusb/CMakeLists.txt:109 (add_library): Cannot find source file: libusb/libusb/core.c Tried extensions .c .C .c++ .cc .cpp .cxx .cu .mpp .m .M .mm .h .hh .h++ .hm .hpp .hxx .in .txx .f .F .for .f77 .f90 .f95 .f03 .ispc CMake Error at externals/libusb/CMakeLists.txt:109 (add_library): No SOURCES given to target: usb ... The attached patch let us bypass the pkgconf test and successfully find the libusb from the base. ... -- Checking for module 'libusb-1.0' -- Found libusb-1.0, version 1.0.13 -- Found libusb-1.0: /usr/include, /usr/lib/libusb.so ...
FYI, the following commit broke FreeBSD. https://github.com/yuzu-emu/yuzu/commit/55dd027115e72ca2ffc6a0bbf8f131d380c73faa
A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/ports/commit/?id=b2a8fc817e26955c5c60f9bcc540a7d335aa41bc commit b2a8fc817e26955c5c60f9bcc540a7d335aa41bc Author: Jan Beich <jbeich@FreeBSD.org> AuthorDate: 2021-06-15 22:43:01 +0000 Commit: Jan Beich <jbeich@FreeBSD.org> CommitDate: 2021-07-27 15:10:27 +0000 emulators/yuzu: unbreak with pkgconf after 72cb3d2eba79 CMake Error at externals/libusb/CMakeLists.txt:109 (add_library): Cannot find source file: libusb/libusb/core.c Tried extensions .c .C .c++ .cc .cpp .cxx .cu .mpp .m .M .mm .h .hh .h++ .hm .hpp .hxx .in .txx .f .F .for .f77 .f90 .f95 .f03 .ispc CMake Error at externals/libusb/CMakeLists.txt:109 (add_library): No SOURCES given to target: usb PR: 256912 Submitted by: jkim (based on) emulators/yuzu/Makefile | 1 + emulators/yuzu/distinfo | 2 ++ 2 files changed, 3 insertions(+)
A commit in branch 2021Q3 references this bug: URL: https://cgit.FreeBSD.org/ports/commit/?id=f2b114375a433c9d980953d1191bcb6e5dcfc3fb commit f2b114375a433c9d980953d1191bcb6e5dcfc3fb Author: Jan Beich <jbeich@FreeBSD.org> AuthorDate: 2021-06-15 22:43:01 +0000 Commit: Jan Beich <jbeich@FreeBSD.org> CommitDate: 2021-07-27 15:11:03 +0000 emulators/yuzu: unbreak with pkgconf after 72cb3d2eba79 CMake Error at externals/libusb/CMakeLists.txt:109 (add_library): Cannot find source file: libusb/libusb/core.c Tried extensions .c .C .c++ .cc .cpp .cxx .cu .mpp .m .M .mm .h .hh .h++ .hm .hpp .hxx .in .txx .f .F .for .f77 .f90 .f95 .f03 .ispc CMake Error at externals/libusb/CMakeLists.txt:109 (add_library): No SOURCES given to target: usb PR: 256912 Submitted by: jkim (based on) (cherry picked from commit b2a8fc817e26955c5c60f9bcc540a7d335aa41bc) emulators/yuzu/Makefile | 1 + emulators/yuzu/distinfo | 2 ++ 2 files changed, 3 insertions(+)
Sorry it took so long. I've tried to come up with an upstreamable fix but failed, opting to simplify your version instead.