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

build: Make libSDL2 optional and only link orblcd against it #144

Merged
merged 1 commit into from
Jun 3, 2024

Conversation

ALTracer
Copy link
Contributor

@ALTracer ALTracer commented Jun 2, 2024

While building this suite on Windows 10 under Msys2 UCRT64 I encountered that I have to extract libSDL2.dll and carry it in the "redist" archive to be able to run any of resulting binaries on other machines. Also nothing compiled until I installed said libSDL2 via pacman.

Looking at #143 I wrote a small patch, knowing very little meson, which decouples libSDL2 from command-line tools, and that hypothetically allows me to omit both orblcd and libSDL2.dll and have smaller redist archives (we don't use orblcd in our development workflows).

This is a follow-up to the discussion from 10 days ago.

$ objdump -p build-gcc12/orblcd | grep NEEDED
  NEEDED               libasan.so.8
  NEEDED               liborb.so.2.1.0
  NEEDED               libSDL2-2.0.so.0
  NEEDED               libc.so.6
$ objdump -p build-gcc12/orbuculum | grep NEEDED
  NEEDED               libasan.so.8
  NEEDED               liborb.so.2.1.0
  NEEDED               libusb-1.0.so.0
  NEEDED               libc.so.6
$ objdump -p build-gcc12/orbtop | grep NEEDED
  NEEDED               libasan.so.8
  NEEDED               liborb.so.2.1.0
  NEEDED               libc.so.6

Ignore the libasan, what's important is only needed libraries are linked for each respective tool. I have yet to test this on Windows, so please allow some time before merging.

If ucrt64 actually links more than needed, then I may want to decouple libzmq in a similar way (we don't use orbzmq either). I'm open for discussion whether my meson-fu allows me to tackle that here.

* Only orblcd requires libSDL2.
* Allow building the command-line tools if libSDL2 is not found.
* Don't link them all against libSDL2.
@zyp
Copy link
Collaborator

zyp commented Jun 2, 2024

Looks good to me, and handling libzmq in the same way should be fine.

@mubes mubes merged commit 293b46e into orbcode:main Jun 3, 2024
2 of 3 checks passed
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