Foundation converted to CMake

(Saleem Abdulrasool) #1

Hello fellow developers,

Thanks to help from @Michael_Gottesman and @millenomi, Foundation (and CoreFoundation) are now ported to CMake and the build bots are officially using the CMake based build system for the builds! This now brings nearly the entire suite of support libraries into the CMake fold, giving a roughly consistent build throughout the project (llvm, clang, cmark, swift, libdispatch, foundation, xctest are all using CMake now). It also enables cross-compilation and makes it easier to port to other targets.

This should be mostly transparent to most people, but is still a definitely improvement in the work to maintain the project.

One of the interesting bits from this work was the fallout where during the conversion it became apparent that we were building XCTest in a particular configuration but testing it completely differently due to the complexity in build-script-impl. Hopefully it will be possible to remove some of the complexity there now that we can build everything in a similar fashion.

(Lily Vulcano) #2

Note that we will continue maintaining the Xcode project for some time in Foundation, but a goal is that moving forward CMake will be used to generate build setups — the aim is to replace the current hand-built xcodeprojs with ways that ultimately will use CMake to generate those files instead.

(Tony Parker) #3

Congrats on completing this work @compnerd, @millenomi, and @Michael_Gottesman!

(Ben D. Jones) #4


(Michael Gottesman) #5

@compnerd can you elaborate on the XCTest issue? I just would like to understand how we were building and how we were testing/etc.

(Saleem Abdulrasool) #6

@Michael_Gottesman - sure! So, we were building XCTest using the CMake based build system, and then when it came time to test, we were using the old script to build and run tests against. This means that we were doing a bunch of unnecessary work on the build bots but also that we would possibly package a version built completely differently from what we intended.

Really, I think this speaks to the complexity in the build script (impl) based orchestration. I'm hoping that we we can do an integrated build where we can test and build images all within a single system (CMake) to avoid this type of problem in the future.

(Michael Gottesman) #7

Nice catch! Thanks for explaining! = ).