Replies: 3 comments
-
If webgpu has a cmake install script, then calling cmake.install() in on_install will automatically add its headers to the package installation directory. Please check cmakelists.txt and the package installation directory to make sure the installed headers exist. These are not necessary.
|
Beta Was this translation helpful? Give feedback.
-
If you install failed, you can check the failed installation directory
If header files is missing in include, you need copy and install them in on_install on_install(function (package)
local configs = {}
table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release"))
table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF"))
import("package.tools.cmake").install(package, configs)
os.cp("include dir", package:installdir("include")) -- TODO
end) |
Beta Was this translation helpful? Give feedback.
-
@waruqi you're a machine 👏. It's a treat to see you run the project, answer everyone's questions... Thank you. You're answers helped me understand the concepts better (e.g. I was biased from other build systems to add more include paths rather than copying files into a default include path) and pointed in the right direction. You're right that dawn doesn't install the headers by default. There's extra flags for that. After fixing that I still had issues with the cmake build itself. It's almost like build wasn't deterministic because a dependency edge was missing. I guess dawn cmake is an afterthought and they use gn (or else) for Chrome 🤷♀️ . I tried the gn integration and ran into other issues. Since I'm not to hung up on any particular webgpu implementation I also tried wgpu-native, which has a broken meson build. It builds am empty static library archive :sigh: None of the above mentioned issues have anything to do with xmake. I'll keep trying. I don't wanna steal anymore of your time 🙏 |
Beta Was this translation helpful? Give feedback.
-
Hi makers,
Let me start by saying, I'm probably just holding it wrong but even after looking at dozens of xmake.lua files I haven't found the right incantation yet.
I'm trying to add the dawn webgpu implementation as a dependency. Dawn's cmake build process builds headers under "/gen/include". I've tried various versions of what I've found, i.e.
printing the package definition contains:
So the
$(buildir)
approach didn't expand (not sure why) but the on_load approach seemed to have worked. Yet, the `on_test_ cxxfuncs test fails with:I didn't find a way to see the actual compiler invocation but I assume it doesn't contain the includedirs listed above, otherwise I'd expect it to work.
Just double checking the above include path:
it points to the correct generated artifacts.
FYI, I'm using xmake
xmake v2.8.7+20240227
from the debian repos.Any thoughts?
Beta Was this translation helpful? Give feedback.
All reactions