The else is slightly different but I confirmed that only the first
if is run, so presumably that is the correct one.
Details
- Reviewers
Ericson2314 phosek
Diff Detail
- Repository
- rG LLVM Github Monorepo
Unit Tests
Event Timeline
This was added in https://reviews.llvm.org/D105765 by @Ericson2314.
The else adds ${COMPILER_RT_OS_DIR} as well, not sure if this was left in by mistake.
This works in tandem with https://github.com/llvm/llvm-project/blob/2f8ac1804827026b44f429dce02730da18a73c50/compiler-rt/cmake/Modules/CompilerRTUtils.cmake#L442-L458 so I expect the else to be needed. Have you tested this on Darwin? What's the motivation for this cleanup? Have you noticed any issue caused by D105765?
I think we can combine the two branches and rely solely on https://github.com/llvm/llvm-project/blob/2f8ac1804827026b44f429dce02730da18a73c50/compiler-rt/cmake/Modules/CompilerRTUtils.cmake#L442-L458 for constructing the final path, but it's going to need some additional cleanup (these paths are also used for code signing on Darwin).
This is actually me misunderstanding cmake syntax. else(<condition>) doesn't actually check the condition, it's just noting that it's the else for an if that had that condition. If it were an elseif, then it would be checking the condition.
So the else is not dead code after all.