[6.1.0] Allow .wasm cc executable and dynamic library extension (#17440)

* Add .wasm cc artifact executable extension

This allows creating a custom cc_toolchain that compiles to WebAssembly that outputs a wasm file with the standard extension, without needing to have a genrule that renames the file

Closes #16091.

PiperOrigin-RevId: 503921110
Change-Id: I3ed9e50a945d2e415e2ab34bd99ceea481c987f0

* Add .wasm cc dynamic library extension

Similar to #16091 except also allow the `.wasm` extension for dynamic libraries.

Closes #17374.

PiperOrigin-RevId: 507668339
Change-Id: Id85f98bb804e573e5f93a922b67baf75a22baf16

---------

Co-authored-by: Scott Bennett <scottbennett@google.com>
Co-authored-by: kshyanashree <109167932+kshyanashree@users.noreply.github.com>
diff --git a/src/main/java/com/google/devtools/build/lib/rules/cpp/ArtifactCategory.java b/src/main/java/com/google/devtools/build/lib/rules/cpp/ArtifactCategory.java
index 1a2416c..e726c63 100644
--- a/src/main/java/com/google/devtools/build/lib/rules/cpp/ArtifactCategory.java
+++ b/src/main/java/com/google/devtools/build/lib/rules/cpp/ArtifactCategory.java
@@ -22,8 +22,8 @@
 public enum ArtifactCategory {
   STATIC_LIBRARY("lib", ".a", ".lib"),
   ALWAYSLINK_STATIC_LIBRARY("lib", ".lo", ".lo.lib"),
-  DYNAMIC_LIBRARY("lib", ".so", ".dylib", ".dll"),
-  EXECUTABLE("", "", ".exe"),
+  DYNAMIC_LIBRARY("lib", ".so", ".dylib", ".dll", ".wasm"),
+  EXECUTABLE("", "", ".exe", ".wasm"),
   INTERFACE_LIBRARY("lib", ".ifso", ".tbd", ".if.lib", ".lib"),
   PIC_FILE("", ".pic"),
   INCLUDED_FILE_LIST("", ".d"),