diff options
author | Ilkka Saarelainen <ilkka.saarelainen@siru.fi> | 2021-11-11 18:02:02 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-11-11 16:02:02 +0000 |
commit | 209d92e2c27a333e723d24497e8c7a07b2f2eb39 (patch) | |
tree | 911516f170f3804f7d27b8910639bf8a5125f83f | |
parent | 21e07d7e7c99264a894698cd62c579b6f8178daa (diff) | |
download | amber-209d92e2c27a333e723d24497e8c7a07b2f2eb39.tar.gz |
Add support for new location of CTS inl files (#968)
The generated inl files in Vulkan CTS have been moved to another directory and the files
are being generated at build time. To support this, Amber needs a cmake dependency
to the target that generates the files and the directory needs to be included.
This commit adds those changes.
-rw-r--r-- | src/CMakeLists.txt | 4 | ||||
-rw-r--r-- | src/vulkan/CMakeLists.txt | 9 |
2 files changed, 12 insertions, 1 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 901681f..abf5bdc 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -124,6 +124,10 @@ endif() if (${Vulkan_FOUND}) target_link_libraries(libamber libamberenginevulkan) target_include_directories(libamber PRIVATE "${VulkanHeaders_INCLUDE_DIR}") + + if (${VULKAN_CTS_HEADER} AND DEFINED AMBER_CTS_INL_DIR) + target_include_directories(libamber PRIVATE "${AMBER_CTS_INL_DIR}") + endif() endif() if (${Dawn_FOUND}) target_link_libraries(libamber libamberenginedawn) diff --git a/src/vulkan/CMakeLists.txt b/src/vulkan/CMakeLists.txt index b633c71..37bdd1f 100644 --- a/src/vulkan/CMakeLists.txt +++ b/src/vulkan/CMakeLists.txt @@ -43,6 +43,13 @@ target_include_directories(libamberenginevulkan PRIVATE "${CMAKE_BINARY_DIR}") # Add the Vulkan include directory to the list of include paths. target_include_directories(libamberenginevulkan PRIVATE "${VulkanHeaders_INCLUDE_DIR}") +# When building with dEQP Vulkan CTS the inl files needs to be included and a dependency +# must be added to the target `deqp-vk-inl` that generates the inl files. +if (${VULKAN_CTS_HEADER} AND DEFINED AMBER_CTS_INL_DIR) + target_include_directories(libamberenginevulkan PRIVATE "${AMBER_CTS_INL_DIR}") + add_dependencies(libamberenginevulkan deqp-vk-inl) +endif() + set_target_properties(libamberenginevulkan PROPERTIES OUTPUT_NAME "amberenginevulkan" ) @@ -52,7 +59,7 @@ endif() if(${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang") # vulkan/vulkan.h defines VK_NULL_HANDLE as 0u and that also serves as a null pointer. - # Disable Clang's warning that will alwaays fire on that. This is required to build + # Disable Clang's warning that will always fire on that. This is required to build # with XCode 10. target_compile_options(libamberenginevulkan PRIVATE -Wno-zero-as-null-pointer-constant) endif() |