All core libraries have been migrated to modern CMake

Hello fellow developers,

This is to announce that the last of the staging is now complete. All of the core libraries (libdispatch, foundation, XCTest) are now being built with CMake 3.15.1. This is largely transparent for most people (though a clean build won't hurt).

The biggest advantage that this brings is that the builds are much simpler, with largely a declaration of the sources and the libraries that they correspond to. There are still some improvements which can be done to the build system, but, this is a much better state that we are in now. The builds should also now be generally better at doing incremental builds, parallel builds, and ensure that re-compilation cycles are detected properly. It also has greatly simplified the cross-compilation of the libraries.

I am going to be removing some of the leftovers in the build-script as we now use proper export'ed targets from CMake so that CMake can understand when the target has changed and the sources need to be re-compiled. This simplification also means that we should be able to avoid doing clean builds of libdispatch, foundation, XCTest on the CI (which should hopefully speed up some of our builds). The compiler itself is tracked by CMake, which means that if the compiler changes, it will trigger the re-compilation of the targets.

Thank you to @Aciid for helping with getting some of these changes through.

CC: @millenomi @smontgomery @Michael_Gottesman

20 Likes

Nice!

Woo :tada:

I think being able to target Windows and Android as well as being able to easily develop with Swift on Windows will help bring Swift to the next level on the quest of Total World Domination (and bring more people to the community). This is very exciting progress, great work!

1 Like