Skip to content

Fixed CMake argument omission causing build failure in Shader modules chapter#146

Merged
gpx1000 merged 2 commits intoKhronosGroup:mainfrom
butchhartman:shader_module_cmake_fix
Aug 22, 2025
Merged

Fixed CMake argument omission causing build failure in Shader modules chapter#146
gpx1000 merged 2 commits intoKhronosGroup:mainfrom
butchhartman:shader_module_cmake_fix

Conversation

@butchhartman
Copy link
Copy Markdown
Contributor

The CMake documentation defines the version of cmake_parse_arguments() used in the add_slang_shader_target() function provided in this chapter with the following signature:

cmake_parse_arguments(<prefix> <options> <one_value_keywords>
                      <multi_value_keywords> <args>...)

The current usage of cmake_parse_arguments() in this chapter produces a multiple definition warning and causes build failures due to ${ARGN} being interpreted as the <multi_value_keywords> parameter.

The proposed solution is to add an additional empty set of quotation marks before the "SOURCES" argument to properly pass the arguments to the ${SHADER_SOURCES} variable.

This categorizes ${SHADER_SOURCES} as a multi value keyword. I do not know if ${SHADER_SOURCES} was intended to be a multi or single value keyword, but I opted to select multi value keyword to be consistent with the plurality used throughout the chapter.

This was tested using CMake version 3.29

@gpx1000 gpx1000 merged commit afa478c into KhronosGroup:main Aug 22, 2025
4 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants