Files
CMake/Modules/Internal/CMakeSYCLFilterImplicitLibs.cmake
2026-10-13 14:59:23 -04:00

17 lines
759 B
CMake

# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file LICENSE.rst or https://cmake.org/licensing for details.
macro(cmake_sycl_filter_implicit_libs variable)
foreach(library IN LISTS ${variable})
get_filename_component(library_name "${library}" NAME)
if(library_name MATCHES "^(lib)?sycl([0-9]+d?|-devicelib-host)?([.]lib|[.]a|[.]so([.][0-9]+)*|[.]dylib)?$")
list(APPEND CMAKE_SYCL_RUNTIME_LIBRARY_LINK_OPTIONS_DEFAULT "${library}")
list(REMOVE_ITEM ${variable} "${library}")
endif()
endforeach()
if(CMAKE_SYCL_RUNTIME_LIBRARY_LINK_OPTIONS_DEFAULT)
list(REMOVE_DUPLICATES CMAKE_SYCL_RUNTIME_LIBRARY_LINK_OPTIONS_DEFAULT)
set(CMAKE_SYCL_RUNTIME_LIBRARY_DEFAULT DEFAULT)
endif()
endmacro()