Skip to content

[libclc] only check filename part of the source for avoiding duplication #135710

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions libclc/cmake/modules/AddLibclc.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -466,16 +466,22 @@ function(libclc_configure_lib_source LIB_FILE_LIST)
## Add the generated convert files here to prevent adding the ones listed in
## SOURCES
set( rel_files ${${LIB_FILE_LIST}} ) # Source directory input files, relative to the root dir
set( objects ${${LIB_FILE_LIST}} ) # A "set" of already-added input files
# A "set" of already-added input files
set( objects )
foreach( f ${${LIB_FILE_LIST}} )
get_filename_component( name ${f} NAME )
list( APPEND objects ${name} )
endforeach()

foreach( l ${source_list} )
file( READ ${l} file_list )
string( REPLACE "\n" ";" file_list ${file_list} )
get_filename_component( dir ${l} DIRECTORY )
foreach( f ${file_list} )
get_filename_component( name ${f} NAME )
# Only add each file once, so that targets can 'specialize' builtins
if( NOT ${f} IN_LIST objects )
list( APPEND objects ${f} )
if( NOT ${name} IN_LIST objects )
list( APPEND objects ${name} )
list( APPEND rel_files ${dir}/${f} )
endif()
endforeach()
Expand Down
Loading