vk_video_samples icon indicating copy to clipboard operation
vk_video_samples copied to clipboard

Specify CMake generator in build scripts

Open kkartaltepe opened this issue 1 year ago • 3 comments

Currently update_external_sources.sh::build_glslang in the decoder project does not specify a generator and assumes the user has not configured an alternative default (a relatively new feature in CMake).

It would help to avoid issues to specify the generator explicitly with -G "Unix Makefiles" (similar to build_shaderrc) when you do not use the generator aware cmake build wrapper functions.

kkartaltepe avatar May 15 '23 00:05 kkartaltepe

Hi kkartaltepe, currently shaderrc is built using the Ninja generator. Would you like for us to change this to GnuMake, as well?

zlatinski avatar Mar 28 '24 22:03 zlatinski

This bug is not about the chosen build generator, only making your own choices work on other people's machines.

If you hardcode the generator into your script, you should also hard code the generator into your cmake calls. This way your script works when the default on my machine is not the default on your machine.

kkartaltepe avatar Mar 29 '24 01:03 kkartaltepe

For example,

https://github.com/nvpro-samples/vk_video_samples/blob/main/vk_video_decoder/update_external_sources.sh#L87

Correctly specifies -G Ninja and then hardcodes calls to ninja.

https://github.com/nvpro-samples/vk_video_samples/blob/main/vk_video_decoder/update_external_sources.sh#L58

Incorrectly creates using the default generator, and then hardcodes calls to make. This is often found in legacy cmake code prior to the introduction of configuration default generators and the generator aware cmake --build command line.

kkartaltepe avatar Mar 29 '24 01:03 kkartaltepe