Swift-config

swift-config encapsulates information about a Swift project configuration for use by other project's build environments (to determine installed path, available features, required libraries, etc.).

PR: [tool] swift-config by krzyzanowskim · Pull Request #19628 · apple/swift · GitHub

feedback is welcome

1 Like

Nice work accounting for all of the Windows environment factors as well.

As I mentioned in the PR, this functionality is already supported by Swift exporting its variables via SwiftConfig.cmake.in. LLVM has been trying to get rid of llvm-config for years in favor of just using LLVMConfig.cmake.in. It would be unfortunate to go down that path.

If the issue is around linking against an installed swift, if we do not already we can provide a pkg-config file (or something like that) to get this info (I think cmake can create one).

@krzyzanowskim I would be more than happy to provide an example of how to do this from an external cmake project if it would be helpful.

2 Likes