[emscripten] Add missing header to (non-pkg) CMake build

The CMake build files for Emdawnwebgpu had a bug where they were relying
on the system include paths in Emscripten. Now that Emscripten has
removed USE_WEBGPU, there's no include path that includes
webgpu/webgpu_enum_class_bitmasks.h.

This shims that in via emdawnwebgpu_headers_gen, same as what we did
with webgpu_glfw.h.

The originally-reported bug can be reproduced by building
emdawnwebgpu_init_only_sample with CMake on Emscripten 4.0.18. (Will
roll that separately to make sure this works both before and after.)

Fixed: 456628846
Change-Id: I8e15c3d629e36fec85d2443c941d1a2af532a437
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/270194
Auto-Submit: Kai Ninomiya <kainino@chromium.org>
Reviewed-by: François Beaufort <fbeaufort@google.com>
Reviewed-by: Loko Kung <lokokung@google.com>
Commit-Queue: Loko Kung <lokokung@google.com>
diff --git a/src/emdawnwebgpu/CMakeLists.txt b/src/emdawnwebgpu/CMakeLists.txt
index 3dc9552..0e6877d 100644
--- a/src/emdawnwebgpu/CMakeLists.txt
+++ b/src/emdawnwebgpu/CMakeLists.txt
@@ -35,12 +35,16 @@
 add_custom_target(emdawnwebgpu_headers_gen
     DEPENDS ${EMDAWNWEBGPU_HEADERS_GEN_HEADERS}
 )
-# Also copy the webgpu_glfw.h file.
-add_custom_command(TARGET emdawnwebgpu_headers_gen POST_BUILD
-    COMMAND ${CMAKE_COMMAND} -E copy
-        "${DAWN_INCLUDE_DIR}/webgpu/webgpu_glfw.h"
-        "${EM_BUILD_GEN_DIR}/include/webgpu/"
-)
+# Also copy some extra files that we need to be able to include without their siblings.
+macro(emdawnwebgpu_headers_gen_add filename)
+    add_custom_command(TARGET emdawnwebgpu_headers_gen POST_BUILD
+        COMMAND ${CMAKE_COMMAND} -E copy
+            "${DAWN_INCLUDE_DIR}/webgpu/${filename}"
+            "${EM_BUILD_GEN_DIR}/include/webgpu/${filename}"
+    )
+endmacro()
+emdawnwebgpu_headers_gen_add("webgpu_glfw.h")
+emdawnwebgpu_headers_gen_add("webgpu_enum_class_bitmasks.h")
 
 DawnJSONGenerator(
     TARGET "emdawnwebgpu_js"
@@ -228,7 +232,7 @@
             "${EM_BUILD_GEN_DIR}/include/dawn/webgpu_cpp_print.h"
             "${EM_BUILD_GEN_DIR}/include/webgpu/webgpu_cpp.h"
             "${EM_BUILD_GEN_DIR}/include/webgpu/webgpu_cpp_chained_struct.h"
-            "${DAWN_INCLUDE_DIR}/webgpu/webgpu_enum_class_bitmasks.h"
+            "${EM_BUILD_GEN_DIR}/include/webgpu/webgpu_enum_class_bitmasks.h"
         DEPENDS
             emdawnwebgpu_c
     )
@@ -253,7 +257,7 @@
 
         # Copy webgpu_enum_class_bitmasks.h
         COMMAND ${CMAKE_COMMAND} -E copy
-            "${DAWN_INCLUDE_DIR}/webgpu/webgpu_enum_class_bitmasks.h"
+            "${EM_BUILD_GEN_DIR}/include/webgpu/webgpu_enum_class_bitmasks.h"
             "${CMAKE_BINARY_DIR}/emdawnwebgpu_pkg/webgpu_cpp/include/webgpu/"
 
         # Copy webgpu_glfw.h