rules_swift_package_manager icon indicating copy to clipboard operation
rules_swift_package_manager copied to clipboard

Support `system` target types

Open cgrindel opened this issue 2 years ago • 3 comments

Looking for a popular package that leverages system targets (i.e, systemLibrary).

#235 was reported as a failure to support system targets. However, it turns out that the real issue was that targets were not being properly filtered out before build file generation. For instance, test targets and targets only associated with phantom products should not be built.

cgrindel avatar Feb 28 '23 21:02 cgrindel

Hi! What about https://github.com/groue/GRDB.swift ?

denis15yo avatar Mar 26 '23 14:03 denis15yo

@denis15yo Cool. Thanks. I will try to pick this up in the next couple of weeks.

cgrindel avatar Mar 26 '23 15:03 cgrindel

This is a minimal BUILD file it seems we would need to get something like CSQLite generated (this is used in GRDB.swift for example):

load("@rules_cc//cc:defs.bzl", "cc_library")
load("@build_bazel_rules_swift//swift:swift.bzl", "swift_library_group", "swift_interop_hint")

swift_library_group(
    name = "CSQLite",
    deps = [
        ":CSQLite_system_library",
    ],
)

cc_library(
    name = "CSQLite_system_library",
    hdrs = ["shim.h"],
    aspect_hints = [":CSQLite_swift_interop"],
)

swift_interop_hint(
    name = "CSQLite_swift_interop",
    module_map = "module.modulemap",
    module_name = "CSQLite",
)

luispadron avatar Sep 15 '24 00:09 luispadron