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

GLFW on Linux only needs to be linked with libGL since version 3.1.2 #57

Open
1 of 2 tasks
liquidev opened this issue Oct 14, 2020 · 1 comment
Open
1 of 2 tasks

Comments

@liquidev
Copy link

  • I'm submitting a ...

    • bug report
    • feature request
  • What is the current behavior?

NimGL links all these unnecessary libraries when compiling GLFW:

{.passL: "-pthread -lGL -lX11 -lXrandr -lXxf86vm -lXi -lXcursor -lm -lXinerama".}

Excerpt from the GLFW changelog:

image

  • If the current behavior is a bug, please provide the steps to reproduce and
    if possible a minimal demo of the problem

Just use NimGL's GLFW wrapper.

  • What is the expected behavior?

NimGL should only link to libGL and maybe pthread.

  • What is the motivation / use case for changing the behavior?

By linking to all the X11-related libraries we're only pulling in unnecessary hard dependencies to executables. This might prove running NimGL executables difficult on Wayland-only environments. Also, requiring users to install all of those libraries is just plain inconvenient in the long run.

  • Please tell us about your environment:

    • Version: 1.1.5
    • OS: Linux
    • Bindings: GLFW
  • Other information (e.g. detailed explanation, stacktraces, related issues,
    suggestions how to fix, links for us to have context, eg. stackoverflow,
    docs.gl, documentation etc)

The solution should be simple; replace the current line with this:

{.passL: "-pthread -lGL".} 

By the way, linking to libm is unnecessary as Nim links it by default.

@lmariscal
Copy link
Member

Thanks for the explanation, fixed by 1298b31.
Tested in xorg-server 1.20.10, would like to know if there are any inconveniences in Wayland. Can't personally test since I use nvidia drivers.

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

No branches or pull requests

2 participants