Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SR-13980] SwiftPM does not treat headerSearchPath as a target relative path when generating xcodeproj. #4458

Closed
kateinoigakukun opened this issue Dec 21, 2020 · 3 comments
Labels

Comments

@kateinoigakukun
Copy link
Member

Previous ID SR-13980
Radar rdar://problem/72558644
Original Reporter @kateinoigakukun
Type Bug
Environment

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

Additional Detail from JIRA
Votes 1
Component/s Package Manager
Labels Bug
Assignee None
Priority Medium

md5: b1a28aaedfa4ce21532b7f92dceab770

Issue 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)

@typesanitizer
Copy link

@swift-ci create

@neonichu
Copy link
Member

neonichu commented Jan 5, 2021

Sounds right to me.

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
@shahmishal shahmishal transferred this issue from apple/swift May 4, 2022
@ikesyo
Copy link
Collaborator

ikesyo commented Mar 25, 2024

generate-xcodeproj command doesn't exist anymore. Closing.

@ikesyo ikesyo closed this as not planned Won't fix, can't repro, duplicate, stale Mar 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants