diff --git a/sycl/.gitignore b/sycl/.gitignore new file mode 100644 index 0000000000000..6f61542267633 --- /dev/null +++ b/sycl/.gitignore @@ -0,0 +1 @@ +include/CL/sycl/version.hpp diff --git a/sycl/CMakeLists.txt b/sycl/CMakeLists.txt index e7a13097ba617..219f9fba74551 100644 --- a/sycl/CMakeLists.txt +++ b/sycl/CMakeLists.txt @@ -98,25 +98,32 @@ set(sycl_inc_dir ${CMAKE_CURRENT_SOURCE_DIR}/include) set(sycl_src_dir ${CMAKE_CURRENT_SOURCE_DIR}/source) set(sycl_plugin_dir ${CMAKE_CURRENT_SOURCE_DIR}/plugins) string(TIMESTAMP __SYCL_COMPILER_VERSION "%Y%m%d") +set(version_header "${sycl_inc_dir}/CL/sycl/version.hpp") +configure_file("${version_header}.in" "${version_header}") + +# This is workaround to detect changes (add or modify) in subtree which +# are not detected by copy_directory command. +# 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/*") # Copy SYCL headers from sources to build directory add_custom_target(sycl-headers DEPENDS ${SYCL_INCLUDE_BUILD_DIR}/sycl + ${SYCL_INCLUDE_BUILD_DIR}/sycl/sycl.hpp ${SYCL_INCLUDE_BUILD_DIR}/sycl/CL) add_custom_command( OUTPUT ${SYCL_INCLUDE_BUILD_DIR}/sycl + ${SYCL_INCLUDE_BUILD_DIR}/sycl/sycl.hpp ${SYCL_INCLUDE_BUILD_DIR}/sycl/CL - DEPENDS ${sycl_inc_dir}/sycl - ${sycl_inc_dir}/CL + DEPENDS ${HEADERS_IN_SYCL_DIR} + ${HEADERS_IN_CL_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 COMMENT "Copying SYCL headers ...") -configure_file("${sycl_inc_dir}/CL/sycl/version.hpp.in" "${SYCL_INCLUDE_BUILD_DIR}/CL/sycl/version.hpp") - - -# Copy SYCL headers from sources to install directory +# 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) diff --git a/xpti/CMakeLists.txt b/xpti/CMakeLists.txt index 6acf7250d7aeb..cc57d795e7073 100644 --- a/xpti/CMakeLists.txt +++ b/xpti/CMakeLists.txt @@ -77,12 +77,13 @@ set(LIBRARY_OUTPUT_PATH ${CMAKE_BINARY_DIR}) add_subdirectory(src) if (LLVM_BINARY_DIR) + file(GLOB_RECURSE XPTI_HEADERS_LIST CONFIGURE_DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/include/xpti/*") add_custom_target(xpti-headers DEPENDS ${LLVM_BINARY_DIR}/include/xpti) add_custom_command( OUTPUT ${LLVM_BINARY_DIR}/include/xpti - DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/include/xpti + DEPENDS ${XPTI_HEADERS_LIST} COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_CURRENT_SOURCE_DIR}/include/xpti ${LLVM_BINARY_DIR}/include/xpti