This addresses the longstanding FIXME and makes libc++ build more
similar to other runtimes. This is also necessary to enable the use
of script for synchronizing source lists between the CMake and GN
builds which relies on explicit source lists.
Details
Diff Detail
- Repository
- rL LLVM
Event Timeline
I'd remove the GN build bits from the CL description. The GN build shouldn't be motivation for changing anything in CMake land since it's not supported. But I think it's a good change on its own. I'm not a libc++ code owner, so wait for one of mclow or ericwf or ldionne too.
LGTM.
As the CMake docs suggest, we should never have been doing this.
Thanks for cleaning it up.
Last time this came up, we wanted to implement a check to ensure no source files were forgotten, as in do a glob and compare to the explicit list of files. The original plan was to use llvm_process_sources for that, but we couldn't do that cos libc++'s build can't rely on LLVM being around yet (though maybe we ought to reconsider that at some point with the upcoming monorepo move...). Do you think it's worth implementing that?
Is it possible to forget a file, without it failing some lit test?
Are globs used elsewhere in llvm's cmake for this reason? I hope not. I don't remember it causing much issues.
The original plan was to use llvm_process_sources for that, but we couldn't do that cos libc++'s build can't rely on LLVM being around yet (though maybe we ought to reconsider that at some point with the upcoming monorepo move...).
Passing-by 2 cent: that seems like an unreasonably high price for an insufficiently motivating reason.
Do you think it's worth implementing that?
Whatever we do, I think it's important not to assume that all of LLVM is around for building libc++. The standalone build currently works well without LLVM around (actually, better than the non-standalone one because LLVM pollutes global CMake variables), and I think we should keep that working.
llvm_process_sources gets used implicitly all over LLVM's build system, and it implements the glob check. We don't use globs to construct the actual source list, just to verify it.
I agree that llvm_process_sources by itself isn't enough reason to introduce an LLVM dependency in libc++'s build system, but the general sentiment at the time was that we wanted to share more build infrastructure as well.