-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[CMake] Simplify two binary variables into one tri-state variable #32042
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
Conversation
@swift-ci please test |
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.
Making the Swift build system more similar to the LLVM options is definitely a good idea.
# FIXME: On Apple platforms, find_program needs to look for "ld64.lld" | ||
find_program(LDLLD_PATH "ld.lld") | ||
if((SWIFT_ENABLE_LLD_LINKER AND LDLLD_PATH AND NOT APPLE) OR | ||
if((SWIFT_USE_LINKER STREQUAL "lld") OR |
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.
I think that we should simplify this like the previous case in cmake/modules/AddSwift.cmake
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.
The parts that I know (the Android parts, mostly), looks fine to me. Should be functionally equivalent to the existing code. There's only that one point that should be double checked. Otherwise looks good.
("${LFLAGS_SDK}" STREQUAL "WINDOWS" AND | ||
NOT "${CMAKE_SYSTEM_NAME}" STREQUAL "WINDOWS")) | ||
list(APPEND result "-fuse-ld=lld") | ||
elseif(SWIFT_ENABLE_GOLD_LINKER AND | ||
elseif(SWIFT_USE_LINKER STREQUAL "gold" AND |
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.
I think the manipulations around these lines (L418-L422) are the same to the ones in AddSwiftUnittests.cmake
, but the modifications are different: some checks are kept here, while they are drop in the other file. Is the divergence intentional?
Build failed |
Also remove some ancient logic to detect and ignore requests to use LLD. If people want to explicitly use LLD, they probably have a reason and we shouldn't second guess them.
Hi @compnerd and @drodriguez – I've simplified AddSwiftStdlib.cmake more. I think we should make @swift-ci please test |
Build failed |
Build failed |
@swift-ci please clean test linux |
Yeah, I agree on the idea that if the user specified it, we assume correct and honor it. |
@swift-ci please test windows |
Also remove some ancient logic to detect and ignore requests to use LLD. If people want to explicitly use LLD, they probably have a reason and we shouldn't second guess them.