I noticed this wile investigating https://llvm.org/PR61314
Details
Details
- Reviewers
ldionne - Group Reviewers
Restricted Project - Commits
- rGc416234c3841: [libc++] Disables transitive includes in library.
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
libcxx/include/__config | ||
---|---|---|
278–279 ↗ | (On Diff #504158) | I don't understand. Why would this make a difference whether a user sets it or not? We should be able to set this when building the library, just like we set _LIBCPP_BUILDING_LIBRARY (and I think we should set it in CMake). |
libcxx/include/__config | ||
---|---|---|
278–279 ↗ | (On Diff #504158) | I'm not sure whether that would break some unexpected cases where vendors do things we don't expect. |
Comment Actions
LGTM once set within CMake
libcxx/include/__config | ||
---|---|---|
278–279 ↗ | (On Diff #504158) | Hmm yes, I think this would be the better approach: target_compile_definitions(${target} PRIVATE -D_LIBCPP_BUILDING_LIBRARY) // Make sure the library can be build without transitive includes. This makes // it easier to upgrade the library to a newer language standard without build // errors. target_compile_definitions(${target} PRIVATE -D_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) |
libcxx/include/__config | ||
---|---|---|
278–279 ↗ | (On Diff #504158) | Thanks both for the feedback. I was doubting between these two options. |