wgpu-native
wgpu-native copied to clipboard
Modularizing CMakeLists
Recently I have introduced the BACKEND
parameter and its error handling for the hello_triangle
example. Now that I am working on the hello_compute
example I am encountering that I have to copy and paste some of its code.
Maybe it is an idea to create CMake helper files, so that every CMake file is able to tap into it and use it. I am not a particular expert in CMake, but I know there are many options for modularizing projects.
Some useful things that could be accomplished with doing this:
- Able to use the backend checking
- Able to use the logic which takes care of including the
.lib
files and linking of platform specifics - Able to generalize the scripts for the examples directories, so that whenever there will be an example added, there would be less work get it up and running
Can we instead just have a single Cmake file with multiple targets?
Agreed, for now that would make it easier, I think my proposal would be overkill for now.
Possibly fixed earlier too, but recently #252 did the modularization of all examples.