Uploaded image for project: 'Swift'
  1. Swift
  2. SR-13980

SwiftPM does not treat headerSearchPath as a target relative path when generating xcodeproj.

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open
    • Priority: Medium
    • Resolution: Unresolved
    • Component/s: Package Manager
    • Labels:
      None
    • Environment:

      $ swift package --version
      Swift Package Manager - Swift 5.3.0

      Description

      SwiftPM supports to specify custom header directories with .headerSearchPath with target directory relative path. It adds -I options to compiler arguments.

      let package = Package(
          name: "Example",
          dependencies: [],
          targets: [
              .target(name: "Example", cSettings: [
                  .headerSearchPath("Headers")
              ]),
          ]
      )
      

      "swift package generate-xcodeproj" also adds them to HEADER_SEARCH_PATHS, but it just add it as -I./Headers, which is not resolved as target directory relative path.
      I think SwiftPM should set HEADER_SEARCH_PATHS with $(SRCROOT)/Sources/Example/Headers.

      One temporary workaround is creating a symbolic link of Sources/Example/Headers in project root dir. (like https://github.com/swiftwasm/wamr-swift/tree/aa2991edaf43bc6301972fb3d16c731dad71d25c)

        Attachments

          Activity

            People

            Assignee:
            Unassigned Unassigned
            Reporter:
            yuta_saito Yuta Saito
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

              Dates

              Created:
              Updated: