Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Static link of LibUSB can bypass brew requirement for Mac #140

Open
DeqingSun opened this issue Sep 4, 2024 · 0 comments
Open

Static link of LibUSB can bypass brew requirement for Mac #140

DeqingSun opened this issue Sep 4, 2024 · 0 comments

Comments

@DeqingSun
Copy link
Contributor

Brew is not friendly to older Mac OS systems or newbie users. LibUSB can be statically linked inside the binary.

Here is how I did it.

ifneq (,$(findstring darwin,$(OS_NAME)))
	LIBS=/usr/local/Cellar/libusb/1.0.23/lib/libusb-1.0.a /usr/local/Cellar/libusb-compat/0.1.5_1/lib/libusb.a -ldl -Wl,-framework,IOKit -Wl,-framework,CoreFoundation
else
ifneq (,$(findstring cygwin,$(OS_NAME)))
	LIBS=-lusb-1.0 -Wl,--enable-stdcall-fixup CH375DLL.dll
else
	LIBS=-lusb-1.0
endif
endif

Here is a Github Action build example
https://github.com/DeqingSun/vnproch551/blob/master/.github/workflows/build_for_multiple_os.yml

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant