Add empty WORKSPACE.bzlmod

When bzlmod is enabled and WORKSPACE.bzlmod exists, the content of
WORKSPACE is ignored. This prevents bzlmod builds from unintentionally
depending on the WORKSPACE file.

This exposed some small problems with our clang-cl configuration,
which are also fixed in this change.

PiperOrigin-RevId: 602511311
Change-Id: I0ba411edde2df0e17f4eeede4117ddb6934dd8f8
diff --git a/BUILD.bazel b/BUILD.bazel
index 79fb0ec..03122a9 100644
--- a/BUILD.bazel
+++ b/BUILD.bazel
@@ -1,4 +1,3 @@
-#
 # Copyright 2020 The Abseil Authors.
 #
 # Licensed under the Apache License, Version 2.0 (the "License");
@@ -23,3 +22,14 @@
     "AUTHORS",
     "LICENSE",
 ])
+
+# For building with clang-cl.
+# https://bazel.build/configure/windows#clang
+platform(
+    name = "x64_windows-clang-cl",
+    constraint_values = [
+        "@platforms//cpu:x86_64",
+        "@platforms//os:windows",
+        "@bazel_tools//tools/cpp:clang-cl",
+    ],
+)
diff --git a/MODULE.bazel b/MODULE.bazel
index 18190e8..fc1534a 100644
--- a/MODULE.bazel
+++ b/MODULE.bazel
@@ -20,6 +20,9 @@
     compatibility_level = 1,
 )
 
+cc_configure = use_extension("@bazel_tools//tools/cpp:cc_configure.bzl", "cc_configure_extension")
+use_repo(cc_configure, "local_config_cc")
+
 # Only direct dependencies need to be listed below.
 # Please keep the versions in sync with the versions in the WORKSPACE file.
 
diff --git a/WORKSPACE.bzlmod b/WORKSPACE.bzlmod
new file mode 100644
index 0000000..83e67ba
--- /dev/null
+++ b/WORKSPACE.bzlmod
@@ -0,0 +1,19 @@
+# Copyright 2024 The Abseil Authors.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#      https://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+# https://bazel.build/external/migration#workspace.bzlmod
+#
+# This file is intentionally empty. When bzlmod is enabled and this
+# file exists, the contents of WORKSPACE is ignored. This prevents
+# bzlmod builds from unintentionally depending on the WORKSPACE file.
diff --git a/absl/BUILD.bazel b/absl/BUILD.bazel
index 14c30b3..253c0ae 100644
--- a/absl/BUILD.bazel
+++ b/absl/BUILD.bazel
@@ -68,17 +68,6 @@
     visibility = [":__subpackages__"],
 )
 
-# x64_windows-clang-cl - used for selecting clang-cl for CI builds
-platform(
-    name = "x64_windows-clang-cl",
-    constraint_values = [
-        "@platforms//cpu:x86_64",
-        "@platforms//os:windows",
-        "@bazel_tools//tools/cpp:clang-cl",
-    ],
-    visibility = [":__subpackages__"],
-)
-
 config_setting(
     name = "osx",
     constraint_values = [
diff --git a/ci/windows_clangcl_bazel.bat b/ci/windows_clangcl_bazel.bat
index 5162628..ac2f916 100755
--- a/ci/windows_clangcl_bazel.bat
+++ b/ci/windows_clangcl_bazel.bat
@@ -49,7 +49,7 @@
   --define=absl=1 ^
   --distdir=%KOKORO_GFILE_DIR%\distdir ^
   --enable_bzlmod=true ^
-  --extra_execution_platforms=//absl:x64_windows-clang-cl ^
+  --extra_execution_platforms=//:x64_windows-clang-cl ^
   --extra_toolchains=@local_config_cc//:cc-toolchain-x64_windows-clang-cl ^
   --keep_going ^
   --test_env="GTEST_INSTALL_FAILURE_SIGNAL_HANDLER=1" ^