CMake use in Swift


(Colin Cornaby) #1

We support tons of different platforms, but we've traditionally use separate project files for each platform (VC projects/solutions for Windows, xcodeproj for Apple platforms, scripts or make for Linux, scripts for Android...) Recently our lower level teams have been agreeing that CMake is the best way forward to wrangle this mess, but some of our Apple platform devs have expressed concern that they don't know if the CMake output for Xcode will reliably pick good defaults compared to a hand maintained Xcode project.

Our CMake proponents are very excited to see Swift using CMake as it gives us a prominent use case for CMake on Apple platforms. We've seen CMake support previously in platforms like WebKit, but seeing it in Swift really got people excited.

It would be great to have some sort of blog post on the Swift project's use of CMake, especially in it's build output for Mac/iOS, and if there have been any pitfalls or any custom work Apple has done under the Swift project to make this process cleaning. Material on supporting iOS in CMake especially seems lacking.


(Chris Lattner) #2

Hi Colin,

FWIW, we also use CMake in the LLVM family of projects, which Swift works very closely with.

-Chris

ยทยทยท

On Dec 3, 2015, at 2:20 PM, Colin Cornaby <colin.cornaby@mac.com> wrote:

We support tons of different platforms, but we've traditionally use separate project files for each platform (VC projects/solutions for Windows, xcodeproj for Apple platforms, scripts or make for Linux, scripts for Android...) Recently our lower level teams have been agreeing that CMake is the best way forward to wrangle this mess, but some of our Apple platform devs have expressed concern that they don't know if the CMake output for Xcode will reliably pick good defaults compared to a hand maintained Xcode project.

Our CMake proponents are very excited to see Swift using CMake as it gives us a prominent use case for CMake on Apple platforms. We've seen CMake support previously in platforms like WebKit, but seeing it in Swift really got people excited.