Skip to content

Commit 64a095c

Browse files
authored
[SYCL][UR] Improve header copy dependencies (#17093)
When copying the UR headers to `build/include` make sure that the `sycl-headers` target knowns about the dependencies upon the headers in `unified-runtime/include` and make sure that they are copied when changed. This should hopefully also stop occasional failures in CI: ``` In file included from /__w/llvm/llvm/src/unified-runtime/source/adapters/native_cpu/ur_interface_loader.cpp:11: /__w/llvm/llvm/build/include/ur_api.h:15: error: unterminated #ifndef ```
1 parent 097a447 commit 64a095c

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

sycl/CMakeLists.txt

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -234,25 +234,31 @@ string(REPLACE "${sycl_inc_dir}" "${SYCL_INCLUDE_BUILD_DIR}"
234234
string(REPLACE "${sycl_inc_dir}" "${SYCL_INCLUDE_BUILD_DIR}"
235235
OUT_HEADERS_IN_SYCLCOMPAT_DIR "${HEADERS_IN_SYCLCOMPAT_DIR}")
236236

237+
set(OUT_UR_HEADERS
238+
${SYCL_INCLUDE_BUILD_DIR}/ur_api.h
239+
${SYCL_INCLUDE_BUILD_DIR}/ur_api_funcs.def
240+
${SYCL_INCLUDE_BUILD_DIR}/ur_print.hpp)
241+
set(UR_HEADERS_TO_COPY
242+
${UNIFIED_RUNTIME_INCLUDE_DIR}/ur_api.h
243+
${UNIFIED_RUNTIME_INCLUDE_DIR}/ur_api_funcs.def
244+
${UNIFIED_RUNTIME_INCLUDE_DIR}/ur_print.hpp)
245+
237246
# Copy SYCL headers from sources to build directory
238247
add_custom_target(sycl-headers
239248
DEPENDS ${OUT_HEADERS_IN_SYCL_DIR}
240249
${OUT_HEADERS_IN_CL_DIR}
241250
${OUT_HEADERS_IN_STD_DIR}
242251
${OUT_HEADERS_IN_SYCLCOMPAT_DIR}
252+
${OUT_UR_HEADERS}
243253
sycl-device-aspect-macros-header
244254
boost_mp11-headers)
245255

246-
list(APPEND UR_HEADERS_TO_COPY
247-
${UNIFIED_RUNTIME_INCLUDE_DIR}/ur_api.h
248-
${UNIFIED_RUNTIME_INCLUDE_DIR}/ur_api_funcs.def
249-
${UNIFIED_RUNTIME_INCLUDE_DIR}/ur_print.hpp
250-
)
251256
add_custom_command(
252257
OUTPUT ${OUT_HEADERS_IN_SYCL_DIR}
253258
${OUT_HEADERS_IN_CL_DIR}
254259
${OUT_HEADERS_IN_STD_DIR}
255260
${OUT_HEADERS_IN_SYCLCOMPAT_DIR}
261+
${OUT_UR_HEADERS}
256262
DEPENDS ${HEADERS_IN_SYCL_DIR}
257263
${HEADERS_IN_CL_DIR}
258264
${HEADERS_IN_STD_DIR}

0 commit comments

Comments
 (0)