summaryrefslogtreecommitdiff
path: root/libclc/cmake
diff options
context:
space:
mode:
Diffstat (limited to 'libclc/cmake')
-rw-r--r--libclc/cmake/modules/AddLibclc.cmake20
1 files changed, 18 insertions, 2 deletions
diff --git a/libclc/cmake/modules/AddLibclc.cmake b/libclc/cmake/modules/AddLibclc.cmake
index 5cc202ddbaa8..aa8dd9859cd2 100644
--- a/libclc/cmake/modules/AddLibclc.cmake
+++ b/libclc/cmake/modules/AddLibclc.cmake
@@ -92,19 +92,35 @@ function(link_bc)
${ARGN}
)
- set( LINK_INPUT_ARG ${ARG_INPUTS} )
+ if( ARG_INTERNALIZE )
+ set( inputs_with_flag ${ARG_INPUTS} )
+ else()
+ # Add the --override flag for non-generic bitcode files so that their
+ # symbols can override definitions in generic bitcode files.
+ set( inputs_with_flag )
+ foreach( file IN LISTS ARG_INPUTS )
+ string( FIND ${file} "/generic/" is_generic )
+ if( is_generic LESS 0 )
+ list( APPEND inputs_with_flag "--override" )
+ endif()
+ list( APPEND inputs_with_flag ${file} )
+ endforeach()
+ endif()
+
if( WIN32 OR CYGWIN )
# Create a response file in case the number of inputs exceeds command-line
# character limits on certain platforms.
file( TO_CMAKE_PATH ${LIBCLC_ARCH_OBJFILE_DIR}/${ARG_TARGET}.rsp RSP_FILE )
# Turn it into a space-separate list of input files
- list( JOIN ARG_INPUTS " " RSP_INPUT )
+ list( JOIN inputs_with_flag " " RSP_INPUT )
file( GENERATE OUTPUT ${RSP_FILE} CONTENT ${RSP_INPUT} )
# Ensure that if this file is removed, we re-run CMake
set_property( DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS
${RSP_FILE}
)
set( LINK_INPUT_ARG "@${RSP_FILE}" )
+ else()
+ set( LINK_INPUT_ARG ${inputs_with_flag} )
endif()
if( ARG_INTERNALIZE )