libftdi Archives

Subject: Re: macOS build problem due to latest patch

From: Xiaofan Chen <xiaofanc@xxxxxxxxx>
To: libftdi@xxxxxxxxxxxxxxxxxxxxxxx
Cc: Fabrice Fontaine <fontaine.fabrice@xxxxxxxxx>
Date: Sun, 26 Mar 2023 15:10:33 +0800
On Sun, Mar 26, 2023 at 3:05 PM Xiaofan Chen <xiaofanc@xxxxxxxxx> wrote:
>
> It seems to me the last patch has caused issues to build libftdi gt
> under macOS.
>
> Once I revert the patch, it works fine.

If I enable verbose Makefile, I can see that libusb linker option is
not applied correctly.

[  9%] Linking C shared library libftdi1.dylib
cd /Users/mcuee/build/libftdi/libftdi/build/src &&
/opt/homebrew/Cellar/cmake/3.26.1/bin/cmake -E cmake_link_script
CMakeFiles/ftdi1.dir/link.txt --verbose=1
/Library/Developer/CommandLineTools/usr/bin/cc -O2 -g -DNDEBUG -arch
arm64 -isysroot
/Library/Developer/CommandLineTools/SDKs/MacOSX13.1.sdk -dynamiclib
-Wl,-headerpad_max_install_names -compatibility_version 2.0.0
-current_version 2.5.0 -o libftdi1.2.5.0.dylib -install_name
/Users/mcuee/build/libftdi/libftdi/build/src/libftdi1.2.dylib
CMakeFiles/ftdi1.dir/ftdi.c.o CMakeFiles/ftdi1.dir/ftdi_stream.c.o
-lusb-1.0
ld: library not found for -lusb-1.0
clang: error: linker command failed with exit code 1 (use -v to see invocation)

mcuee@mcuees-Mac-mini libftdi % pkg-config --libs libusb-1.0
-L/opt/homebrew/Cellar/libusb/HEAD-fcf0c71/lib -lusb-1.0
mcuee@mcuees-Mac-mini libftdi % pkg-config --cflags libusb-1.0
-I/opt/homebrew/Cellar/libusb/HEAD-fcf0c71/include/libusb-1.0

-- 
Xiaofan

--
libftdi - see http://www.intra2net.com/en/developer/libftdi for details.
To unsubscribe send a mail to libftdi+unsubscribe@xxxxxxxxxxxxxxxxxxxxxxx

Current Thread