rules_swift_package_manager icon indicating copy to clipboard operation
rules_swift_package_manager copied to clipboard

fix: usage of `copts` for `SWIFT_PACKAGE`

Open luispadron opened this issue 1 year ago • 2 comments

This primarily does two changes:

  • Passes -Xcc -DSWIFT_PACKAGE for the Swift library target generated copts attribute.
  • Removes de-duplication in bzl_selects.bzl
    • This is required because copts = ["-DSWIFT_PACKAGE", "-Xcc", "-DSWIFT_PACKAGE"] are valid copts but would get de-duplicated into copts = ["-DSWIFT_PACKAGE", "-Xcc"]

Fixes #1259

luispadron avatar Sep 25 '24 20:09 luispadron

Added an example repo and example in: https://github.com/cgrindel/rules_swift_package_manager/pull/1261

luispadron avatar Sep 26 '24 02:09 luispadron

I'll need to update this because we do want to dedupe some attrs (like deps) across configs/defaults but not copt. Going to look at making a new method for this

luispadron avatar Sep 26 '24 19:09 luispadron

@cgrindel this should be ready now, I updated the PR description and the example in #1261 that can be added after this merges.

luispadron avatar Jan 15 '25 06:01 luispadron