[libclc] [libclc][NFC] Prioritize clang's built-in opencl-c-base.h over CPATH versions (PR #177754)

Alexey Bader via cfe-commits cfe-commits at lists.llvm.org
Mon Jan 26 08:14:35 PST 2026


================
@@ -411,7 +420,7 @@ foreach( t ${LIBCLC_TARGETS_TO_BUILD} )
       -I${CMAKE_CURRENT_SOURCE_DIR}/clc/include
       # Error on undefined macros
       -Werror=undef
-      -fdiscard-value-names
+      -fdiscard-value-names -nostdinc
----------------
bader wrote:

Do we need `-nostdinc`?

> This occurs because clang's header search order is:
> 
> 1. Command line -I flags
> 2. CPATH directories
> 3. Builtin resource directories (added automatically)

Based on this order, the include path added by `-I` below should be used instead of the directories in `CPATH` environment variable.

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


More information about the cfe-commits mailing list