wgpu-native icon indicating copy to clipboard operation
wgpu-native copied to clipboard

Modularizing CMakeLists

Open Napokue opened this issue 5 years ago • 2 comments

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

Napokue avatar Jun 01 '19 19:06 Napokue

Can we instead just have a single Cmake file with multiple targets?

kvark avatar Jun 02 '19 00:06 kvark

Agreed, for now that would make it easier, I think my proposal would be overkill for now.

Napokue avatar Jun 02 '19 10:06 Napokue

Possibly fixed earlier too, but recently #252 did the modularization of all examples.

rajveermalviya avatar Jun 06 '23 06:06 rajveermalviya