[libc-commits] [libc] [libc] Use -nostdlibinc in the full build mode (PR #97461)

Petr Hosek via libc-commits libc-commits at lists.llvm.org
Tue Jul 2 12:23:37 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()
----------------
petrhosek wrote:

Done.

https://github.com/llvm/llvm-project/pull/97461


More information about the libc-commits mailing list