This is an archive of the discontinued LLVM Phabricator instance.

[CMake] Passthrough OSX CMake options to builtins and runtimes
ClosedPublic

Authored by phosek on Jan 10 2022, 2:55 PM.

Details

Summary

When using the default target, there's no other way to pass these
into the builtins and runtimes subbuilds.

Diff Detail

Event Timeline

phosek created this revision.Jan 10 2022, 2:55 PM
phosek requested review of this revision.Jan 10 2022, 2:55 PM
Herald added a project: Restricted Project. · View Herald TranscriptJan 10 2022, 2:55 PM
smeenai accepted this revision.Jan 13 2022, 5:43 PM

LGTM

This revision is now accepted and ready to land.Jan 13 2022, 5:43 PM

Actually, could you give an example of the type of variables you want to pass in? I thought the CMAKE_OSX_* options were mostly for setting OS and architecture, which the Darwin compiler-rt build does itself anyway.

Actually, could you give an example of the type of variables you want to pass in? I thought the CMAKE_OSX_* options were mostly for setting OS and architecture, which the Darwin compiler-rt build does itself anyway.

Yes, the concrete example we ran into recently is CMAKE_OSX_DEPLOYMENT_TARGET which is set here https://github.com/llvm/llvm-project/blob/58ec17cb4ea4f3b76f0c948cf4c894ea7ea43552/clang/cmake/caches/Fuchsia-stage2.cmake#L49. In the future I'd also like to take advantage of CMAKE_OSX_ARCHITECTURES to build libc++ as a universal library.

I'm not particular happy with this approach since the runtimes build might accidentally pick up a flag you didn't intend to, which is the motivation for D117263.

Actually, could you give an example of the type of variables you want to pass in? I thought the CMAKE_OSX_* options were mostly for setting OS and architecture, which the Darwin compiler-rt build does itself anyway.

Yes, the concrete example we ran into recently is CMAKE_OSX_DEPLOYMENT_TARGET which is set here https://github.com/llvm/llvm-project/blob/58ec17cb4ea4f3b76f0c948cf4c894ea7ea43552/clang/cmake/caches/Fuchsia-stage2.cmake#L49. In the future I'd also like to take advantage of CMAKE_OSX_ARCHITECTURES to build libc++ as a universal library.

I'm not particular happy with this approach since the runtimes build might accidentally pick up a flag you didn't intend to, which is the motivation for D117263.

Ah, right, I forgot that runtimes other than compiler-rt don't do any of its special OS/architecture handling. This makes sense then.