================
@@ -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)
----------------
wenju-he wrote:
it seems difficult to do it top down. The old code also does the same and
include parent's folder:
https://github.com/llvm/llvm-project/blob/732f66eccc24fc90c9fe9df65bfbe3ddedf220fc/libclc/cmake/modules/AddLibclc.cmake#L301
https://github.com/llvm/llvm-project/pull/185598
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits