Skip to content

Issues with passing defines to shaderc #19

@lbd-alex

Description

@lbd-alex

I've written my own version of bgfx_compile_shaders() to compile all provided variants of a given shader - _bgfx_shaderc_parse() does expose the --define CLI option, however there is a typo in the option name (--defines instead of --define) and it looks like the semicolons aren't escaped quite enough times to get around CMake list expansion:

# --define
if(ARG_DEFINES)
list(APPEND CLI "--defines")
set(DEFINES "")
foreach(DEFINE ${ARG_DEFINES})
if(NOT "${DEFINES}" STREQUAL "")
set(DEFINES "${DEFINES}\\\\;${DEFINE}")
else()
set(DEFINES "${DEFINE}")
endif()
endforeach()
list(APPEND CLI "${DEFINES}")
endif()

I am aware this is not part of the public interface, but figured I would report this anyway incase it does end up getting used at some point.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions