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

Merged
merged 3 commits into from
Dec 12, 2024

Conversation

JetbladeDevsStuff
Copy link
Contributor

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.

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
Contributor 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.

@Ralim
Copy link
Collaborator

Ralim commented Dec 11, 2024

@JetbladeDevsStuff

I can't test/validate for macOS sadly. I'm happy to merge this as I think to my knowledge it looks good. Could you do a re-base on the latest just to make sure CI etc is happy?

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.
@JetbladeDevsStuff
Copy link
Contributor Author

Only 9 months later, lol. CI should be able to run now.

@Ralim
Copy link
Collaborator

Ralim commented Dec 12, 2024

Yeah huge apologies on this 😢 I never got notifications and the main maintainer has been snowed under by work+life.

I'll be around now for future 😅

@Ralim Ralim merged commit bfe472e into pine64:master Dec 12, 2024
8 checks passed
@JetbladeDevsStuff
Copy link
Contributor Author

Thanks, and I have been loving the Pinecil too.

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.

3 participants