Skip to content

Commit 04f76af

Browse files
authored
[SYCL][libdevice] Cross compilation fixes. (#19593)
* Ensure that when LLVM_USE_HOST_TOOLS=ON, we depend not just on the cross build of tools, but also on the host build of tools. * Ensure that when LLVM_USE_HOST_TOOLS=ON, we make the SYCL headers available to nativecpu_utils.cpp, since it will not be available implicitly.
1 parent b4a744c commit 04f76af

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

libdevice/cmake/modules/SYCLLibdevice.cmake

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -410,7 +410,7 @@ if (NOT MSVC AND UR_SANITIZER_INCLUDE_DIR)
410410
include/sanitizer_defs.hpp
411411
include/spir_global_var.hpp
412412
include/sanitizer_utils.hpp
413-
sycl-compiler)
413+
${sycl-compiler_deps})
414414

415415
set(tsan_obj_deps
416416
device.h atomic.hpp spirv_vars.h
@@ -419,7 +419,7 @@ if (NOT MSVC AND UR_SANITIZER_INCLUDE_DIR)
419419
include/sanitizer_defs.hpp
420420
include/spir_global_var.hpp
421421
include/sanitizer_utils.hpp
422-
sycl-compiler)
422+
${sycl-compiler_deps})
423423
endif()
424424

425425
if("native_cpu" IN_LIST SYCL_ENABLE_BACKENDS)
@@ -431,11 +431,11 @@ if("native_cpu" IN_LIST SYCL_ENABLE_BACKENDS)
431431
add_custom_command(
432432
OUTPUT ${bc_binary_dir}/nativecpu_utils.bc
433433
COMMAND ${clang_exe} ${compile_opts} ${bc_device_compile_opts} -fsycl-targets=native_cpu
434-
-I ${NATIVE_CPU_DIR}
434+
-I ${PROJECT_BINARY_DIR}/include -I ${NATIVE_CPU_DIR}
435435
${CMAKE_CURRENT_SOURCE_DIR}/nativecpu_utils.cpp
436436
-o ${bc_binary_dir}/nativecpu_utils.bc
437437
MAIN_DEPENDENCY nativecpu_utils.cpp
438-
DEPENDS ${sycl-compiler_deps}
438+
DEPENDS sycl-headers ${sycl-compiler_deps}
439439
VERBATIM)
440440
add_custom_target(nativecpu_utils-bc DEPENDS ${bc_binary_dir}/nativecpu_utils.bc)
441441
process_bc(libsycl-nativecpu_utils.bc

0 commit comments

Comments
 (0)