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

Prebuilt releases header files location #410

Closed
Sahnvour opened this issue Aug 18, 2024 · 5 comments · Fixed by #417
Closed

Prebuilt releases header files location #410

Sahnvour opened this issue Aug 18, 2024 · 5 comments · Fixed by #417

Comments

@Sahnvour
Copy link

For consuming the prebuilt releases from a build system (meson in my case), it would help if the headers were placed in a [include]/webgpu subfolder.

When building with other libraries than can use WebGPU (such as imgui) it seems expected to have WebGPU available in the form of #include <webgpu/webgpu.h> (note the leading directory).
However it is currently needed to manually move the headers in a webgpu subfolder after extracting the archive to achieve that and specify correct include paths in the build system.

@almarklein
Copy link
Collaborator

I think that makes sense. That makes it generally easier to extract the contents into a larger project. Probably a good idea to also rename the commit-sha file to wgpu-commit-sha to make it unique.

What exact folder structure are you suggesting, ./wgpu/xx.h or ./include/wgpu/xx.h?

@almarklein
Copy link
Collaborator

@Sahnvour, I'd be happy to write the change to apply your suggestion, but I am not sure what the best folder structure would be.

@Sahnvour
Copy link
Author

Sahnvour commented Sep 2, 2024

In my case, I think the ideal structure would be

.
└── wgpu-release.zip/
    └── wgpu/
        ├── include/
        │   └── webgpu/
        │       ├── webgpu.h
        │       └── wgpu.h
        ├── lib/
        │   ├── wgpu.so
        │   └── wgpu.lib
        └── wgpu-commit-sha

Having a root folder helps (I use meson, which has a feature to workaround if it's missing), and a separate include/lib folders make sure we can't include or link something by error while offering the expected standard include paths.

@almarklein
Copy link
Collaborator

@Korijn what's your thought about this?

@Korijn
Copy link
Contributor

Korijn commented Sep 2, 2024

I'm fine with this! Looks reasonable to me. I wonder if there are more examples like imgui.

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 a pull request may close this issue.

3 participants