ralfbiedert / openh264-rs

Idiomatic Rust wrappers around OpenH264.
66 stars 32 forks source link

Rework the build system, support more systems #28

Closed DCNick3 closed 1 year ago

DCNick3 commented 1 year ago

This PR (once again) reworks the way asm for different platforms is built, as well as adding more CI targets to test it.

For the environment detection I decided to use pattern matching as much as possible, as it is easier to reason about. I have also made the code explicitly bail from building asm if the platform does not seem to be supported.

As for the logic changes, I had to change this stuff:

For the CI I changed up the matrix a bit:

Currently, all targets pass CI: https://github.com/DCNick3/openh264-rust/actions/runs/4168027112/jobs/7214327810

It would be nice to have tests covering arm platforms, and maybe even more, but github hosted runners are x86-only. There are some ways around it (like using qemu), but it didn't seem trivial, so I didn't do it.

Could use at least "it links" check though :thinking:

DCNick3 commented 1 year ago

Well, whoops. Arm is not something supported by nasm, upstream uses a different assembler for it. Ig I will disable the asm support on arm for now then

DCNick3 commented 1 year ago

Added a cargo config for linux arm targets to use a correct linker, for some reason it was using an x86 one

Now the CI also tries to link the arm targets (even though the asm is not used there yet)

https://github.com/DCNick3/openh264-rust/actions/runs/4168902957/jobs/7216231574

ralfbiedert commented 1 year ago

Thank you so much, this is great!