[libc-commits] [libc] [libc] Use -nostdlibinc in the full build mode (PR #97461)
Joseph Huber via libc-commits
libc-commits at lists.llvm.org
Tue Jul 2 12:17:03 PDT 2024
================
@@ -109,10 +117,14 @@ function(_get_common_compile_options output_var flags)
list(APPEND compile_options "SHELL:-Xclang -mcode-object-version=none")
endif()
- # Manually disable all standard include paths and include the resource
- # directory to prevent system headers from being included.
- list(APPEND compile_options "-isystem${COMPILER_RESOURCE_DIR}/include")
- list(APPEND compile_options "-nostdinc")
+ # Manually disable standard include paths to prevent system headers from
+ # being included.
+ if(LIBC_C_SUPPORTS_NOSTDLIBINC)
+ list(APPEND compile_options "-nostdlibinc")
+ else()
+ list(APPEND compile_options "-isystem${COMPILER_RESOURCE_DIR}/include")
+ list(APPEND compile_options "-nostdinc")
+ endif()
----------------
jhuber6 wrote:
I don't think we need to duplicate the logic here, since the GPU libc build should already in full build mode it should hit the condition above.
https://github.com/llvm/llvm-project/pull/97461
More information about the libc-commits
mailing list