Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions Tests/DiligentCoreAPITest/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,21 @@ if(EXISTS "${DILIGENT_NVAPI_PATH}/nvapi.h")
target_compile_definitions(DiligentCoreAPITest PUBLIC DILIGENT_ENABLE_D3D_NVAPI)
endif()

# Add SPIRV-Tools include directories if needed for SPIRVTools.hpp
# Test files that include SPIRVTools.hpp need access to spirv-tools headers
# SPIRVTools.hpp includes "spirv-tools/libspirv.h", so we need the include directory
if (TARGET SPIRV-Tools-opt)
get_target_property(SPIRV_TOOLS_SOURCE_DIR SPIRV-Tools-opt SOURCE_DIR)
get_target_property(SPIRV_TOOLS_BINARY_DIR SPIRV-Tools-opt BINARY_DIR)
get_filename_component(SPIRV_TOOLS_ROOT_DIR "${SPIRV_TOOLS_SOURCE_DIR}/../.." ABSOLUTE)
get_filename_component(SPIRV_TOOLS_ROOT_BINARY_DIR "${SPIRV_TOOLS_BINARY_DIR}/../.." ABSOLUTE)
# Add include subdirectory for public headers like spirv-tools/libspirv.h
target_include_directories(DiligentCoreAPITest PRIVATE
${SPIRV_TOOLS_ROOT_DIR}/include
${SPIRV_TOOLS_ROOT_DIR}
${SPIRV_TOOLS_ROOT_BINARY_DIR}
)
endif()
Comment on lines +154 to +168
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is annoying.
I pushed a change that removes dependency on libspirv.h, so SPIRVTools.hpp can be included without issues.


set_target_properties(DiligentCoreAPITest
PROPERTIES
Expand Down
Loading
Loading