diff --git a/BUILD.bazel b/BUILD.bazel index ca71eeb12f..ac2398a858 100644 --- a/BUILD.bazel +++ b/BUILD.bazel @@ -174,6 +174,23 @@ platform( ], ) +platform( + name = "gcc-windows-x86_64", + constraint_values = [ + ":gcc", + "@platforms//os:windows", + "@platforms//cpu:x86_64", + ], +) + +platform( + name = "windows-x86_64", + constraint_values = [ + "@platforms//os:windows", + "@platforms//cpu:x86_64", + ], +) + alias( name = "urbit", actual = "//pkg/vere:urbit", diff --git a/WORKSPACE.bazel b/WORKSPACE.bazel index 6ecc1294a7..ca1e0b4fe9 100644 --- a/WORKSPACE.bazel +++ b/WORKSPACE.bazel @@ -97,6 +97,7 @@ register_toolchains( "//bazel/toolchain:clang-linux-x86_64-toolchain", "//bazel/toolchain:clang-macos-arm64-toolchain", "//bazel/toolchain:gcc-linux-x86_64-toolchain", + "//bazel/toolchain:gcc-windows-x86_64-toolchain", ) load("@rules_foreign_cc//foreign_cc:repositories.bzl", "rules_foreign_cc_dependencies") diff --git a/bazel/toolchain/BUILD.bazel b/bazel/toolchain/BUILD.bazel index 8511b7fb97..76ac12c8d1 100644 --- a/bazel/toolchain/BUILD.bazel +++ b/bazel/toolchain/BUILD.bazel @@ -247,3 +247,51 @@ toolchain( toolchain = ":clang-macos-arm64", toolchain_type = ":toolchain_type", ) + +# +# gcc-windows-x86_64 +# + +# Toolchain identifier. +_windows_x86_64_gcc = "toolchain-gcc-windows-x86_64" + +cc_toolchain_config( + name = "gcc-windows-x86_64-config", + ar = "/c/ProgramData/chocolatey/bin/ar", + cc = "/c/ProgramData/chocolatey/bin/gcc", + compiler = "gcc", + compiler_version = "//:gcc_version", + ld = "/c/ProgramData/chocolatey/bin/ld", + sys_includes = [ + ], + target_cpu = "x86_64", + toolchain_identifier = _windows_x86_64_gcc, +) + +cc_toolchain( + name = "gcc-windows-x86_64", + all_files = ":empty", + compiler_files = ":empty", + dwp_files = ":empty", + linker_files = ":empty", + objcopy_files = ":empty", + strip_files = ":empty", + supports_param_files = 0, + toolchain_config = ":gcc-windows-x86_64-config", + toolchain_identifier = _windows_x86_64_gcc, +) + +toolchain( + name = "gcc-windows-x86_64-toolchain", + exec_compatible_with = [ + "//:gcc", + "@platforms//os:windows", + "@platforms//cpu:x86_64", + ], + target_compatible_with = [ + "@platforms//os:windows", + "@platforms//cpu:x86_64", + ], + toolchain = ":gcc-windows-x86_64", + toolchain_type = ":toolchain_type", +)