Skip to content

Commit 185a606

Browse files
committed
Patch Windows foreign C++ toolchain for Bazel 9
1 parent c18be0b commit 185a606

3 files changed

Lines changed: 50 additions & 0 deletions

File tree

MODULE.bazel

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,11 @@ bazel_dep(name = "rules_java", version = "9.8.0")
1010
bazel_dep(name = "rules_python", version = "2.3.2")
1111
bazel_dep(name = "rules_shell", version = "0.8.0")
1212

13+
single_version_override(
14+
module_name = "rules_foreign_cc",
15+
patches = ["//third_party/rules_foreign_cc:bazel9_windows_cc_import.patch"],
16+
)
17+
1318
single_version_override(
1419
module_name = "rules_python",
1520
patches = [

third_party/rules_foreign_cc/BUILD

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Copyright 2026 Garena Online Private Limited
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
exports_files(["bazel9_windows_cc_import.patch"])
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
diff --git toolchains/built_toolchains.bzl toolchains/built_toolchains.bzl
2+
--- toolchains/built_toolchains.bzl
3+
+++ toolchains/built_toolchains.bzl
4+
@@ -267,7 +267,7 @@ def _pkgconfig_toolchain(version, register_toolchains):
5+
maybe(
6+
http_archive,
7+
name = "glib_dev",
8+
- build_file_content = '''
9+
+ build_file_content = '''load("@rules_cc//cc:defs.bzl", "cc_import")
10+
cc_import(
11+
name = "glib_dev",
12+
hdrs = glob(["include/**"]),
13+
@@ -285,7 +285,7 @@ cc_import(
14+
maybe(
15+
http_archive,
16+
name = "glib_src",
17+
- build_file_content = '''
18+
+ build_file_content = '''load("@rules_cc//cc:defs.bzl", "cc_import")
19+
cc_import(
20+
name = "msvc_hdr",
21+
hdrs = ["msvc_recommended_pragmas.h"],
22+
@@ -323,7 +323,7 @@ exports_files(
23+
maybe(
24+
http_archive,
25+
name = "gettext_runtime",
26+
- build_file_content = '''
27+
+ build_file_content = '''load("@rules_cc//cc:defs.bzl", "cc_import")
28+
cc_import(
29+
name = "gettext_runtime",
30+
shared_library = "bin/libintl-8.dll",

0 commit comments

Comments
 (0)