-
Notifications
You must be signed in to change notification settings - Fork 110
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
meson: install headers #394
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
inc_dirs += [include_directories('.', is_system: true)] | ||
|
||
headers = files( | ||
'wgpu.h', | ||
'webgpu-headers/webgpu.h' | ||
) | ||
|
||
install_headers(headers, preserve_path: true) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is it your intention for this package to "take over" the dependency of
webgpu.h
? Would it ever make sense to wewebgpu.h
alone withoutwgpu-native
????if so, installing
webgpu.h
might be strange.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm a bit confused as to what you're asking. But I can try to explain how the two header files relate.
The
webgpu.h
is specified alongsidewebgpu.idl
(the JS spec), and can be targeted by any implementation (wgpu-native and Dawn are two examples). That's why its in a separate repo. Thewgpu.h
contains additional functionality specific to desktop/wgpu. As far as I know, it is expected that both will stay separate for the foreseeable future.Does this answer your question?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was my understanding as well.
So to me,
webgpu.h
is not "owned" by thewgpu-native
library and thus should not be installed by it.Rather, some package integrator (this is REALLY annoying for C libraries since no single package manager has surfaced as a winner), is in charge of:
webgpu.h
header.wgpu-native
.wgpu-native
should be checking for compatibility with the installed headerwebgpu.h
prior to starting.So having
wgpu-native
copy over a vendoered version ofwebgpu.h
is somewhat problematic long term.In terms of how this is done in practice, for example, at conda-forge, i declare the build time dependency on
webgpu-headers
, but due to the strict version matching, I must also specify the version i want installed.https://github.com/conda-forge/wgpu-native-feedstock/blob/main/recipe/meta.yaml#L27
Again, the large range of C package manager (mostly non-existant in a cross platform way without conda IMO) means that this is always done in an ad-hoc manner.
In either case, I think that the
webgpu.h
should not be installed here.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm still not sure if I follow :) Might be my limited understanding of C build systems ...
I'm not sure what you mean by wgpu-native installing webgpu.h.
The
webgpu-headers
repo is added as a git submodule, tagged to a specific commit. From time to time, the submodule is bumped to the latest version, and any necessary changes to the source of wgpu-native are made. I think you can consider (the specific version of)webgpu.h
to be part of this repo. Not owned, but definitely pinned.How do you think this can become problematic?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let me try to see how this works in practice and followup with a larger issue if it is a problem.
thakns for your time!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think what @hmaarrfk is trying to say that webgpu-headers should be installed separately instead of installing its header with wgpu-native. I kind of agree with him but this is a relatively minor change I needed for my build system, feel free to change. Users will have to install webgpu-headers/webgpu.h separately though.