Skip to content

Commit e221483

Browse files
committed
[SYCL] Fix build with XPTI disabled
Signed-off-by: Sarnie, Nick <[email protected]>
1 parent 629c7c7 commit e221483

File tree

4 files changed

+16
-3
lines changed

4 files changed

+16
-3
lines changed

sycl/CMakeLists.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -362,6 +362,12 @@ if (NOT WIN32)
362362
COMPONENT sycl-headers-extras)
363363
endif()
364364

365+
if(SYCL_ENABLE_XPTI_TRACING AND
366+
DEFINED LLVM_EXTERNAL_PROJECTS AND
367+
(NOT "xpti" IN_LIST LLVM_EXTERNAL_PROJECTS OR NOT "xptifw" IN_LIST LLVM_EXTERNAL_PROJECTS))
368+
message(FATAL_ERROR "SYCL_ENABLE_XPTI_TRACING=ON but XPTI is not going to be built")
369+
endif()
370+
365371
if (SYCL_ENABLE_XPTI_TRACING)
366372
if (MSVC)
367373
set(XPTIFW_LIBS xpti xptid xptifw xptifwd)

sycl/cmake/modules/FetchUnifiedRuntime.cmake

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@ option(SYCL_UMF_DISABLE_HWLOC
2929
# Here we override the defaults to disable building tests from unified-runtime
3030
set(UR_BUILD_EXAMPLES OFF CACHE BOOL "Build example applications." FORCE)
3131
set(UR_BUILD_TESTS OFF CACHE BOOL "Build unit tests." FORCE)
32-
set(UR_BUILD_XPTI_LIBS OFF)
32+
set(UR_BUILD_XPTI_LIBS OFF CACHE BOOL "")
3333
set(UR_ENABLE_SYMBOLIZER ON CACHE BOOL "Enable symbolizer for sanitizer layer.")
34-
set(UR_ENABLE_TRACING ON)
34+
set(UR_ENABLE_TRACING ON CACHE BOOL "")
3535

3636
set(UR_EXTERNAL_DEPENDENCIES "sycl-headers" CACHE LIST
3737
"List of external CMake targets for executables/libraries to depend on" FORCE)

sycl/unittests/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ if (LLVM_ENABLE_ZSTD)
5454
endif()
5555

5656
# TODO Enable xpti tests for Windows
57-
if (NOT WIN32)
57+
if (SYCL_ENABLE_XPTI_TRACING AND NOT WIN32)
5858
add_subdirectory(xpti_trace)
5959
endif()
6060
add_subdirectory(sampler)

unified-runtime/CMakeLists.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,13 @@ if(NOT MSVC)
136136
endif()
137137
endif()
138138

139+
if(NOT UR_STANDALONE_BUILD AND
140+
UR_ENABLE_TRACING AND
141+
DEFINED LLVM_EXTERNAL_PROJECTS AND
142+
(NOT "xpti" IN_LIST LLVM_EXTERNAL_PROJECTS OR NOT "xptifw" IN_LIST LLVM_EXTERNAL_PROJECTS))
143+
message(FATAL_ERROR "UR_ENABLE_TRACING=ON but XPTI is not going to be built")
144+
endif()
145+
139146
if(UR_ENABLE_TRACING)
140147
add_compile_definitions(UR_ENABLE_TRACING)
141148

0 commit comments

Comments
 (0)