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

Fix lots of build problems on macOS #65

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

JetbladeDevsStuff
Copy link

Building on macOS with native libraries was super broken. This PR fixes dependency location for both argtable3 and libserialport, adding a FindLibserialport CMake module to help. This PR also disables building a x86_64 and arm64 version of blisp by default on macOS, as the cross compiled binary wouldn't be able to link with native libraries.

This new find module will replace the old logic used to locate a native
copy of libserialport. THe old code didn't work on macOS, and was pretty
messy.
While this might work when using bundled libraries, this breaks with
system libraries as they are all compiled for arm64. Also, why would you
need to compile an x86_64 version on arm64, and vise versa.
CMake interpreted `argtable3` to mean add `-largtable3` rather than to
use the imported argtable3 target. This worked when using the bundled
library, but broke with native libraries.
FindLibserialport
-------

Finds the sigrok serial port library (``libserialport``)
Copy link
Collaborator

@robertlipe robertlipe Mar 3, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tying it to sigrok seems super weird.
It's not like this library is optional, IIRC. You either have it correctly installed or you don't, so adding layers to go hunt for it seems a distraction.

Copy link
Author

@JetbladeDevsStuff JetbladeDevsStuff Mar 3, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. Agree, wasn't sure if there were any other libserialport libraries since it felt like a pretty common name.
  2. I don't really get what you're trying to say. In CMake, using a find script is the normal way to link to other libraries. With a find script, standard errors are given when the library isn't found, the call site is much cleaner, and this script can be reused in other projects.

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

Successfully merging this pull request may close these issues.

2 participants