I am trying to compile zlib with rules_foreign_cc and I get the following error in FreeBSD

"fail("No generator set and no default is known. Please set the cmake `generator` attribute")"

My BUILD file is

load("@rules_foreign_cc//foreign_cc:defs.bzl", "cmake")

package(default_visibility = ["//visibility:public"])

filegroup(
    name = "all_srcs",
    srcs = glob(
        include = ["**"],
        exclude = ["*.bazel"],
    ),
)

cmake(
    name = "zlib",
    generate_args = select({
        "@platforms//os:windows": ["-GNinja"],
        "//conditions:default": [],
    }),
    targets = ["install"],
    lib_source = ":all_srcs",
    out_static_libs = select({
        "@platforms//os:windows": ["z.lib"],
        "//conditions:default": ["libz.a"],
    }),
)

The same file for the same zlib package compiles in Ubuntu 16 and MacOS

Any idea why it cannot find the generator and if I have to declare it explicitly under generate_args, what are the valid options?

I tried -Gcc, -Gmake, -Gcmake, but all result in unknown generator.

0

There are 0 best solutions below