diff --git a/perl/toolchain.bzl b/perl/toolchain.bzl index 2768a10..c0c008d 100644 --- a/perl/toolchain.bzl +++ b/perl/toolchain.bzl @@ -40,6 +40,10 @@ def _perl_toolchain_impl(ctx): xsubpp_cmd = _find_tool(ctx, "xsubpp") xs_headers = _find_xs_headers(ctx) + interpreter_cmd_path = interpreter_cmd.path + if ctx.target_platform_has_constraint(ctx.attr._windows_constraint[platform_common.ConstraintValueInfo]): + interpreter_cmd_path = interpreter_cmd.path.replace("/", "\\") + return [ platform_common.ToolchainInfo( name = ctx.label.name, @@ -51,7 +55,7 @@ def _perl_toolchain_impl(ctx): perlopt = ctx.attr.perlopt, ), make_variables = platform_common.TemplateVariableInfo({ - "PERL": interpreter_cmd.path, + "PERL": interpreter_cmd_path, }), ), ] @@ -67,6 +71,7 @@ perl_toolchain = rule( allow_files = True, cfg = "target", ), + "_windows_constraint": attr.label(default = "@platforms//os:windows"), }, doc = "Gathers functions and file lists needed for a Perl toolchain", )