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

introduce intermediate lib for GLFW compilation #31

Closed
slimsag opened this issue Oct 18, 2021 · 0 comments
Closed

introduce intermediate lib for GLFW compilation #31

slimsag opened this issue Oct 18, 2021 · 0 comments
Labels
Milestone

Comments

@slimsag
Copy link
Member

slimsag commented Oct 18, 2021

glfw.link currently from a project adds C sources to the compilation step, rather than linking an intermediate library, and so if you're using it from you're own project with C/C++ code compilation can be slower.

We should default to emitting a static lib, and making glfw.link link to that.

@slimsag slimsag added the glfw label Oct 18, 2021
slimsag added a commit to slimsag/mach-glfw that referenced this issue Oct 24, 2021
Previously, @Avokadoen and @mattnite ran into issues including the GLFW library
in other projects, e.g. Avokadoen/zig_vulkan#17

In #24 we removed the intermediate static library, which solved the issue. The
problem is that when the function is invoked in the directory of the project
including GLFW, then our code:

```
const lib = b.addStaticLibrary("glfw", "src/main.zig");
```

Would refer to the project's `src/main.zig` -- not the GLFW library `main.zig`.

Although removing the intermediate lib worked around the issue, it created a
new one - slower compilation: hexops/mach#31

This fixes the issue by ensuring that the path we pass to `addStaticLibrary` is
in fact absolute, not relative.

Fixes hexops/mach#31

Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
slimsag added a commit to slimsag/mach-glfw that referenced this issue Aug 26, 2022
Previously, @Avokadoen and @mattnite ran into issues including the GLFW library
in other projects, e.g. Avokadoen/zig_vulkan#17

In #24 we removed the intermediate static library, which solved the issue. The
problem is that when the function is invoked in the directory of the project
including GLFW, then our code:

```
const lib = b.addStaticLibrary("glfw", "src/main.zig");
```

Would refer to the project's `src/main.zig` -- not the GLFW library `main.zig`.

Although removing the intermediate lib worked around the issue, it created a
new one - slower compilation: hexops/mach#31

This fixes the issue by ensuring that the path we pass to `addStaticLibrary` is
in fact absolute, not relative.

Fixes hexops/mach#31

Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
@slimsag slimsag added this to the Mach 0.2 milestone Jul 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant