Skip to content

Added an option to include additional directories in embed_devicecode#82

Open
Waqar-ukaea wants to merge 1 commit intogprt-org:masterfrom
Waqar-ukaea:embed-devicecode-include-dirs
Open

Added an option to include additional directories in embed_devicecode#82
Waqar-ukaea wants to merge 1 commit intogprt-org:masterfrom
Waqar-ukaea:embed-devicecode-include-dirs

Conversation

@Waqar-ukaea
Copy link
Contributor

Very minor change here but I wanted to make including headers from another library a little more convenient when compiling the slang code.

A new INCLUDE_DIRS argument has been added to the embed_devicecode() cmake function, allowing users to specify additional include directories that will be passed to slangc via -I flags during shader compilation. It just makes it slightly more convenient for me to include additional headers in my project. I can use project relative includes instead of filesystem relative paths:

#include "../geometry/dp_math.h" ---> OLD
#include "xdg/geometry/dp_math.h" ---> NEW

Example usage of the INCLUDE_DIRS argument:

    embed_devicecode(
    OUTPUT_TARGET
    ${device_code}
    HEADERS
    ${CMAKE_CURRENT_SOURCE_DIR}/include/xdg/gprt/shared_structs.h
    SOURCES
    ${CMAKE_CURRENT_SOURCE_DIR}/src/gprt/${device_code}.slang
    INCLUDE_DIRS
    ${CMAKE_CURRENT_SOURCE_DIR}/include
  )

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.

1 participant