eliemichel / WebGPU-distribution

Distributions of WebGPU for native and web development, easy to integrate and interchangeable.
MIT License
159 stars 29 forks source link

Fails to build dawn #15

Open reeselevine opened 6 months ago

reeselevine commented 6 months ago

Hi, I'm running into an issue trying to include dawn as the WebGPU implementation. I'm adding it to my CMakeLists.txt file this way:

FetchContent_Declare(
  webgpu
  GIT_REPOSITORY https://github.com/eliemichel/WebGPU-distribution
  GIT_TAG        <branch_name>
)
FetchContent_MakeAvailable(webgpu)

But when I build it (i.e. cmake .., cmake --build . in a build directory, I run into errors like this: ‘PCIVendorID’ was not declared in this scope). It looks like the generator python scripts for Dawn are not running, since the files that name these variables aren't being created correctly. Wondering if this is an issue with my setup or this repo.

Some other info: I've tried this on Ubuntu 20.04 and Ubuntu 22.04, Cmake version 3.28.1/3.29.2 respectively, using C++ standard 17. Both systems have python/python3 installed

eliemichel commented 6 months ago

Hello, could you provide a full log of the command that fails? And the exact <branch_name> you are using (the precise git commit if possible).

reeselevine commented 6 months ago

Here's a link to a gist with the log from trying to build, as well as the CMakeLists.txt file I'm using for reference. The specific git commit I'm using from this repository is 022cf0b.

https://gist.github.com/reeselevine/e76be1bc37125b35d7274010fa5c731d

This is running on Ubuntu 20.04.6 LTS, CMake 3.28.1.

eliemichel commented 6 months ago

Thanks! The type PCIVendorID is supposed to be declared in the GPUInfo_autogen.h header, which, as its name suggests, is automatically generated. You can check that it was indeed generated by looking at build/gen/src/dawn/common. The project config step seems to have gone right, but maybe there is an issue in the generation part, check out this file's content!

reeselevine commented 6 months ago

I see that file exists at _deps/dawn-build/gen/src/dawn/common/GPUInfo_autogen.h, but it's contents are empty. Same with GPUInfo_autogen.cpp. So something does seem to be going wrong in the generation part, but I don't see any logs in the build output to let me know what that could be.