-
Notifications
You must be signed in to change notification settings - Fork 14.6k
release/18.x: change the visibility of libc++ header to public in libcxx module #91182
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
Thank you for submitting a Pull Request (PR) to the LLVM Project! This PR will be automatically labeled and the relevant teams will be If you wish to, you can add reviewers by using the "Reviewers" section on this page. If this is not working for you, it is probably because you do not have write If you have received no comments on your PR for a week, you can request a review If you have further questions, they may be answered by the LLVM GitHub User Guide. You can also ask questions in a comment on this PR, on the LLVM Discord or on the forums. |
@llvm/pr-subscribers-libcxx Author: RichardLuo (RichardLuo0) ChangesThis PR addresses a problem that headers may not be able to be found if Consider the following file: #include <boost/json.hpp>
import std;
int main(int, const char **) { } boost will include something from libc++, but we are using -nostdinc++, so the compiler can not find any default std header. Full diff: https://github.com/llvm/llvm-project/pull/91182.diff 1 Files Affected:
diff --git a/libcxx/modules/CMakeLists.txt.in b/libcxx/modules/CMakeLists.txt.in
index e332d70cc16333..1f8f159e710cb9 100644
--- a/libcxx/modules/CMakeLists.txt.in
+++ b/libcxx/modules/CMakeLists.txt.in
@@ -41,7 +41,7 @@ target_sources(std
std.cppm
)
-target_include_directories(std SYSTEM PRIVATE @LIBCXX_CONFIGURED_INCLUDE_DIRS@)
+target_include_directories(std SYSTEM PUBLIC @LIBCXX_CONFIGURED_INCLUDE_DIRS@)
if (NOT @LIBCXX_ENABLE_EXCEPTIONS@)
target_compile_options(std PUBLIC -fno-exceptions)
@@ -67,7 +67,7 @@ target_sources(std.compat
std.compat.cppm
)
-target_include_directories(std.compat SYSTEM PRIVATE @LIBCXX_CONFIGURED_INCLUDE_DIRS@)
+target_include_directories(std.compat SYSTEM PUBLIC @LIBCXX_CONFIGURED_INCLUDE_DIRS@)
if (NOT @LIBCXX_ENABLE_EXCEPTIONS@)
target_compile_options(std.compat PUBLIC -fno-exceptions)
|
The checks error seems to have nothing to do with the changes |
@mordante Do you think we should backport this? |
Is there a similar change that is proposed for the main branch? |
Yes #91240, I forget to mention that here. |
Closing this PR since we are not making any more LLVM 18 releases. This will be included in LLVM 19. |
This PR addresses a problem that headers may not be able to be found if
#include
is used with std modules.Consider the following file:
boost will include something from libc++, but we are using -nostdinc++, so the compiler can not find any default std header.
Therefore the locally built header needs to be public.