Skip to content
Merged
Show file tree
Hide file tree
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
10 changes: 9 additions & 1 deletion sycl/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -147,28 +147,36 @@ configure_file("${feature_header}.in" "${feature_header}")
# TODO: detect and process remove header/directory case
file(GLOB_RECURSE HEADERS_IN_SYCL_DIR CONFIGURE_DEPENDS "${sycl_inc_dir}/sycl/*")
file(GLOB_RECURSE HEADERS_IN_CL_DIR CONFIGURE_DEPENDS "${sycl_inc_dir}/CL/*")
file(GLOB_RECURSE HEADERS_IN_STD_DIR CONFIGURE_DEPENDS "${sycl_inc_dir}/std/*")
string(REPLACE "${sycl_inc_dir}" "${SYCL_INCLUDE_BUILD_DIR}"
OUT_HEADERS_IN_SYCL_DIR "${HEADERS_IN_SYCL_DIR}")
string(REPLACE "${sycl_inc_dir}/CL" "${SYCL_INCLUDE_BUILD_DIR}/sycl/CL"
OUT_HEADERS_IN_CL_DIR "${HEADERS_IN_CL_DIR}")
string(REPLACE "${sycl_inc_dir}" "${SYCL_INCLUDE_BUILD_DIR}"
OUT_HEADERS_IN_STD_DIR "${HEADERS_IN_STD_DIR}")

# Copy SYCL headers from sources to build directory
add_custom_target(sycl-headers
DEPENDS ${OUT_HEADERS_IN_SYCL_DIR}
${OUT_HEADERS_IN_CL_DIR})
${OUT_HEADERS_IN_CL_DIR}
${OUT_HEADERS_IN_STD_DIR})

add_custom_command(
OUTPUT ${OUT_HEADERS_IN_SYCL_DIR}
${OUT_HEADERS_IN_CL_DIR}
${OUT_HEADERS_IN_STD_DIR}
DEPENDS ${HEADERS_IN_SYCL_DIR}
${HEADERS_IN_CL_DIR}
${HEADERS_IN_STD_DIR}
COMMAND ${CMAKE_COMMAND} -E copy_directory ${sycl_inc_dir}/sycl ${SYCL_INCLUDE_BUILD_DIR}/sycl
COMMAND ${CMAKE_COMMAND} -E copy_directory ${sycl_inc_dir}/CL ${SYCL_INCLUDE_BUILD_DIR}/sycl/CL
COMMAND ${CMAKE_COMMAND} -E copy_directory ${sycl_inc_dir}/std ${SYCL_INCLUDE_BUILD_DIR}/std
COMMENT "Copying SYCL headers ...")

# Copy SYCL headers from source to install directory
install(DIRECTORY "${sycl_inc_dir}/sycl" DESTINATION ${SYCL_INCLUDE_DIR} COMPONENT sycl-headers)
install(DIRECTORY "${sycl_inc_dir}/CL" DESTINATION ${SYCL_INCLUDE_DIR}/sycl COMPONENT sycl-headers)
install(DIRECTORY "${sycl_inc_dir}/std" DESTINATION ${SYCL_INCLUDE_DIR} COMPONENT sycl-headers)

set(SYCL_RT_LIBS sycl)
if (MSVC)
Expand Down
Loading