Use dawn_add_library function to create the dawncpp_headers library
Change-Id: I302dc58bf3749ab4fe600562d17b833168092c86
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/194915
Auto-Submit: Jaswant Panchumarti <jaswant.panchumarti@kitware.com>
Commit-Queue: Jaswant Panchumarti <jaswant.panchumarti@kitware.com>
Reviewed-by: dan sinclair <dsinclair@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
diff --git a/src/dawn/CMakeLists.txt b/src/dawn/CMakeLists.txt
index 068a675..166afab 100644
--- a/src/dawn/CMakeLists.txt
+++ b/src/dawn/CMakeLists.txt
@@ -80,14 +80,17 @@
PRINT_NAME "Dawn C++ headers"
OUTPUT_HEADERS DAWNCPP_HEADERS_GEN_HEADERS
)
-
-add_library(dawncpp_headers INTERFACE)
-target_sources(dawncpp_headers PUBLIC
- "${DAWN_INCLUDE_DIR}/webgpu/webgpu_cpp.h"
- "${DAWN_INCLUDE_DIR}/webgpu/webgpu_enum_class_bitmasks.h"
- ${DAWNCPP_HEADERS_GEN_HEADERS}
+dawn_add_library(
+ dawncpp_headers
+ HEADER_ONLY
+ UTILITY_TARGET dawn_internal_config
+ HEADERS
+ "${DAWN_INCLUDE_DIR}/webgpu/webgpu_cpp.h"
+ "${DAWN_INCLUDE_DIR}/webgpu/webgpu_enum_class_bitmasks.h"
+ ${DAWNCPP_HEADERS_GEN_HEADERS}
+ DEPENDS
+ dawn::dawn_headers
)
-target_link_libraries(dawncpp_headers INTERFACE dawn_headers)
install_if_enabled(dawncpp_headers)
add_library(dawncpp ALIAS dawncpp_headers)