Swift-config


(Marcin Krzyzanowski) #1

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: https://github.com/apple/swift/pull/19628

feedback is welcome


(Matt Eaton) #2

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


(Michael Gottesman) #3

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.