-
Notifications
You must be signed in to change notification settings - Fork 1.2k
build: use add_subdirectory
instead of add_external_project
#2004
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
build: use add_subdirectory
instead of add_external_project
#2004
Conversation
This switches the CoreFoundation sub-build to use `add_subdirectory`. This has a few **MAJOR** benefits: - CoreFoundation changes get tracked and cause compile/link triggers - CoreFoundation warnings are surfaced in the build - CoreFoundation dependencies are reflected in the right location - Foundation dependencies are reflected in the right location - The overall build is simpler Eventually, it should be possible to further simplify this. Unfortunately, a couple of hacks are needed to make this work. The sub-projects properties must be cached, but they were just passthrough previously, so this is not too terrible. Additionally, the library control know needs to be saved/restored around it. The worst thing here is the need to manually collect the dependency as we do not have a proper library target for the Foundation (Swift) library. When CMake gains proper Swift support, it should be possible to use `add_library` and get a property target that we can use `target_link_libraries` with permitting the dependency tracking to allow us to get that without manual intervention.
CC: @millenomi @gwynne |
@swift-ci please test |
1 similar comment
@swift-ci please test |
Please test with following PRs: @swift-ci please test |
Please test with following PRs: @swift-ci please test |
Please test with following PRs: @swift-ci please test |
@swift-ci please test |
Please test with following PRs: @swift-ci please test |
Please test with following PRs: @swift-ci please test |
Please test with following PRs: swiftlang/swift#23869 @swift-ci please test |
I think this may have broken the LLDB tests. They can't locate Foundation swift module any more. I think we may need to update swift/utils/build-script-impl ?
|
@adrian-prantl pointed me to https://ci.swift.org/view/LLDB/job/oss-lldb-swift-5.1-incremental-linux-ubuntu-18_04/378/consoleFull#-3714861073122a513-f36a-4c87-8ed7-cbc36a1ec144 which is a 5.1 build. Seems that we need to cross-port the migration path to 5.1. swiftlang/swift#23906 should take care of that. |
This switches the CoreFoundation sub-build to use
add_subdirectory
.This has a few MAJOR benefits:
Eventually, it should be possible to further simplify this.
Unfortunately, a couple of hacks are needed to make this work. The
sub-projects properties must be cached, but they were just passthrough
previously, so this is not too terrible. Additionally, the library
control know needs to be saved/restored around it. The worst thing here
is the need to manually collect the dependency as we do not have a
proper library target for the Foundation (Swift) library. When CMake
gains proper Swift support, it should be possible to use
add_library
and get a property target that we can use
target_link_libraries
withpermitting the dependency tracking to allow us to get that without
manual intervention.