Use dawn_add_library function to create the dawn_native library
Change-Id: If1cdf3824d08b3d26ef7750e921ad82feb6edc53
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/194920
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Jaswant Panchumarti <jaswant.panchumarti@kitware.com>
diff --git a/third_party/CMakeLists.txt b/third_party/CMakeLists.txt
index 41c5dc6..89d3a33 100644
--- a/third_party/CMakeLists.txt
+++ b/third_party/CMakeLists.txt
@@ -123,6 +123,11 @@
add_subdirectory(${DAWN_VULKAN_HEADERS_DIR} "${CMAKE_CURRENT_BINARY_DIR}/vulkan-headers")
endif()
+if (NOT TARGET VulkanUtilityHeaders AND DAWN_ENABLE_VULKAN)
+ message(STATUS "Dawn: using VulkanUtilityLibraries at ${DAWN_VULKAN_UTILITY_LIBRARIES_DIR}")
+ add_subdirectory(${DAWN_VULKAN_UTILITY_LIBRARIES_DIR} "${CMAKE_CURRENT_BINARY_DIR}/vulkan-utility-libraries")
+endif()
+
if (DAWN_ENABLE_SWIFTSHADER AND NOT TARGET vk_swiftshader)
set(SWIFTSHADER_BUILD_TESTS OFF CACHE BOOL "" FORCE)
set(SWIFTSHADER_BUILD_BENCHMARKS OFF CACHE BOOL "" FORCE)
@@ -150,6 +155,11 @@
set(HLSL_ENABLE_FIXED_VER OFF)
set(HLSL_BUILD_DXILCONV OFF)
set(HLSL_INCLUDE_TESTS OFF)
+ # When bundling up dawn, the object files of dxc must be binary compatible with rest of dawn.
+ # The default value of `OFF` adds a macro `_ITERATOR_DEBUG_LEVEL=0`.
+ # This is a problem in `Debug` builds of dawn because all of dawn's objects get compiled
+ # with `_ITERATOR_DEBUG_LEVEL=2`
+ set(HLSL_ENABLE_DEBUG_ITERATORS ON)
set(ENABLE_SPIRV_CODEGEN OFF)
set(SPIRV_BUILD_TESTS OFF)