-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[CMake] Conditionalize generation of .swiftinterface files #20784
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
[CMake] Conditionalize generation of .swiftinterface files #20784
Conversation
Still need to fix the tests that expect the swiftinterface files to be there… |
SWIFT_ENABLE_PARSEABLE_MODULE_INTERFACES is the new setting. rdar://problem/44942414
3b55b05
to
022fe5d
Compare
@swift-ci Please test |
Build failed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, the CMake changes look straightforward. 👍
Build failed |
"${CMAKE_COMMAND}" "-E" "remove" "-f" "${module_doc_file}" | ||
COMMAND | ||
"${CMAKE_COMMAND}" "-E" "remove" "-f" "${interface_file}" | ||
"${CMAKE_COMMAND}" "-E" "remove" "-f" ${module_outputs} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If this works, that is great. I recently learnt that the multi-file variant of the commands was added in CMake 3.5 for some of them :/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, hm. It works on my machine™ but I'll go check before I merge.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like it was in 3.4 at least, and our current oldest supported version is 3.4.3.
// RUN: %empty-directory(%t) | ||
// RUN: for x in %platform-sdk-overlay-dir/*.swiftinterface; do [[ $(basename "$x") = Swift.swiftinterface || $(basename "$x") = simd.swiftinterface || $(basename "$x") = SwiftLang.swiftinterface ]] && continue; %target-swift-frontend "$x" -emit-module -o %t/$(basename "$x" .swiftinterface).swiftmodule -disable-objc-attr-requires-foundation-module -enable-resilience -Fsystem %sdk/System/Library/PrivateFrameworks/ -swift-version 4 -O || echo '%target-os:' $(basename "$x") >> %t/failures.txt; done | ||
// RUN: diff <(grep '%target-os:' %s) <(sort -f %t/failures.txt) | ||
// RUN: for x in %platform-sdk-overlay-dir/*.swiftinterface; do [[ $(basename "$x") = Swift.swiftinterface || $(basename "$x") = simd.swiftinterface || $(basename "$x") = SwiftLang.swiftinterface || $(basename "$x") = '*.swiftinterface' ]] && continue; %target-swift-frontend "$x" -emit-module -o %t/$(basename "$x" .swiftinterface).swiftmodule -disable-objc-attr-requires-foundation-module -enable-resilience -Fsystem %sdk/System/Library/PrivateFrameworks/ -swift-version 4 -O || echo '%target-os:' $(basename "$x") >> %t/failures.txt; done |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ugh, this really makes the test difficult to port on windows :-(.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This test is kind of a mess anyway. I should probably just write a Python script. But I don't think I've made it worse of a mess than it already was.
Unrelated XCTest failure. @swift-ci Please test Linux |
SWIFT_ENABLE_PARSEABLE_MODULE_INTERFACES is the new setting.
rdar://problem/44942414