================
@@ -50,17 +50,20 @@ function(add_libclc_builtin_library target_name)
     ${ARGN}
   )
 
-  set(_inc_dirs)
+  # Append each source's parent directory as an include path to 
COMPILE_OPTIONS.
   foreach(f ${ARG_SOURCES})
-    get_filename_component(dir ${f} DIRECTORY)
-    list(APPEND _inc_dirs ${dir})
+    cmake_path(GET f PARENT_PATH parent_dir)
+    get_property(_existing SOURCE "${f}" DIRECTORY ${LIBCLC_SOURCE_DIR} 
PROPERTY COMPILE_OPTIONS)
+    if(NOT "-I${parent_dir}" IN_LIST _existing)
----------------
arsenm wrote:

I'd rather avoid adding it in the first place. I'm not a fan of adding an 
include to the parent instead of the parent adding the include directory to the 
list 

https://github.com/llvm/llvm-project/pull/185598
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to