CMakeLists.txt: fix static build with libusb and -latomic master
authorFabrice Fontaine <fontaine.fabrice@gmail.com>
Fri, 13 May 2022 16:11:50 +0000 (18:11 +0200)
committerThomas Jarosch <thomas.jarosch@intra2net.com>
Tue, 30 Aug 2022 14:56:37 +0000 (16:56 +0200)
commitb5b8fab6063ad90bb5ef05a72708ecde1796bc81
tree7d8c18d14ed10a8c322daaf090b7901d0577300f
parent0684c1b1be9ccb893829c20a8505c91e101bbf43
CMakeLists.txt: fix static build with libusb and -latomic

Use pkg-config to retrieve libusb dependencies such as -latomic and
avoid the following static build failure:

/nvmedata/autobuild/instance-29/output-1/per-package/libftdi1/host/bin/../lib/gcc/sparc-buildroot-linux-uclibc/10.3.0/../../../../sparc-buildroot-linux-uclibc/bin/ld: /nvmedata/autobuild/instance-29/output-1/per-package/libftdi1/host/sparc-buildroot-linux-uclibc/sysroot/lib/libusb-1.0.a(core.o): in function `libusb_unref_device':
/nvmedata/autobuild/instance-29/output-1/build/libusb-1.0.25/libusb/core.c:1186: undefined reference to `__atomic_fetch_add_4'

Fixes:
 - http://autobuild.buildroot.org/results/1ca7cd85ae60ad4797a6d8a83b2fb51d7eab96d9

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
CMakeLists.txt