From 0cc70c16aaeb2ee20c9d7be2b0d00cb16a348e1f Mon Sep 17 00:00:00 2001 From: Laszlo Csomor Date: Tue, 3 Apr 2018 13:11:10 +0200 Subject: [PATCH 1/2] windows: README.md's example now builds on Windows Depends on: https://github.com/bazelbuild/rules_sass/pull/18 See: https://github.com/bazelbuild/rules_sass/issues/13 --- sass/sass.bzl | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/sass/sass.bzl b/sass/sass.bzl index 1177df9..aa2d0f8 100644 --- a/sass/sass.bzl +++ b/sass/sass.bzl @@ -121,8 +121,24 @@ cc_binary( "@libsass//:srcs", "sassc.c", "sassc_version.h", -], - linkopts = ["-ldl", "-lm"], + ] + select({ + "@bazel_tools//src/conditions:windows": glob([ + "win/**/*.c", + "win/**/*.h", + ]), + "//conditions:default": [], + }), + includes = select({ + "@bazel_tools//src/conditions:windows": ["win/posix"], + "//conditions:default": [], + }), + linkopts = select({ + "@bazel_tools//src/conditions:windows": [], + "//conditions:default": [ + "-ldl", + "-lm", + ], + }), deps = ["@libsass//:headers"], ) """ From 415556fd8f6499af44a334ece8075742b24c4242 Mon Sep 17 00:00:00 2001 From: Laszlo Csomor Date: Tue, 3 Apr 2018 13:50:25 +0200 Subject: [PATCH 2/2] windows: @sassc//:sassc compiles with SassC 3.5.2 --- sass/sass.bzl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sass/sass.bzl b/sass/sass.bzl index aa2d0f8..71388aa 100644 --- a/sass/sass.bzl +++ b/sass/sass.bzl @@ -133,7 +133,7 @@ cc_binary( "//conditions:default": [], }), linkopts = select({ - "@bazel_tools//src/conditions:windows": [], + "@bazel_tools//src/conditions:windows": ["-DEFAULTLIB:shell32.lib"], "//conditions:default": [ "-ldl", "-lm",