diff --git a/sycl/CMakeLists.txt b/sycl/CMakeLists.txt index c6c94c9129dc3..3445350325e0a 100644 --- a/sycl/CMakeLists.txt +++ b/sycl/CMakeLists.txt @@ -359,6 +359,12 @@ if (NOT WIN32) COMPONENT sycl-headers-extras) endif() +if(SYCL_ENABLE_XPTI_TRACING AND + DEFINED LLVM_EXTERNAL_PROJECTS AND + (NOT "xpti" IN_LIST LLVM_EXTERNAL_PROJECTS OR NOT "xptifw" IN_LIST LLVM_EXTERNAL_PROJECTS)) + message(FATAL_ERROR "SYCL_ENABLE_XPTI_TRACING=ON but XPTI is not going to be built") +endif() + if (SYCL_ENABLE_XPTI_TRACING) if (MSVC) set(XPTIFW_LIBS xpti xptid xptifw xptifwd) diff --git a/sycl/cmake/modules/FetchUnifiedRuntime.cmake b/sycl/cmake/modules/FetchUnifiedRuntime.cmake index e7667c41cff63..e96eec28be350 100644 --- a/sycl/cmake/modules/FetchUnifiedRuntime.cmake +++ b/sycl/cmake/modules/FetchUnifiedRuntime.cmake @@ -29,9 +29,9 @@ set(UR_BUILD_TESTS "${SYCL_UR_BUILD_TESTS}" CACHE BOOL "" FORCE) set(UR_BUILD_EXAMPLES "${SYCL_UR_BUILD_TESTS}" CACHE BOOL "" FORCE) # Here we override the defaults to unified-runtime -set(UR_BUILD_XPTI_LIBS OFF) +set(UR_BUILD_XPTI_LIBS OFF CACHE BOOL "") set(UR_ENABLE_SYMBOLIZER ON CACHE BOOL "Enable symbolizer for sanitizer layer.") -set(UR_ENABLE_TRACING ON) +set(UR_ENABLE_TRACING ON CACHE BOOL "") set(UR_EXTERNAL_DEPENDENCIES "sycl-headers" CACHE STRING "List of external CMake targets for executables/libraries to depend on" FORCE) diff --git a/sycl/unittests/CMakeLists.txt b/sycl/unittests/CMakeLists.txt index c08e96ea5330a..32dcca6d809c0 100644 --- a/sycl/unittests/CMakeLists.txt +++ b/sycl/unittests/CMakeLists.txt @@ -57,7 +57,7 @@ if (LLVM_ENABLE_ZSTD) endif() # TODO Enable xpti tests for Windows -if (NOT WIN32) +if (SYCL_ENABLE_XPTI_TRACING AND NOT WIN32) add_subdirectory(xpti_trace) endif() add_subdirectory(sampler) diff --git a/unified-runtime/CMakeLists.txt b/unified-runtime/CMakeLists.txt index 7d1ee861b1879..637111db49f5c 100644 --- a/unified-runtime/CMakeLists.txt +++ b/unified-runtime/CMakeLists.txt @@ -159,6 +159,13 @@ else() set(UR_DPCXX_DEPS "") endif() +if(NOT UR_STANDALONE_BUILD AND + UR_ENABLE_TRACING AND + DEFINED LLVM_EXTERNAL_PROJECTS AND + (NOT "xpti" IN_LIST LLVM_EXTERNAL_PROJECTS OR NOT "xptifw" IN_LIST LLVM_EXTERNAL_PROJECTS)) + message(FATAL_ERROR "UR_ENABLE_TRACING=ON but XPTI is not going to be built") +endif() + if(UR_ENABLE_TRACING) add_compile_definitions(UR_ENABLE_TRACING)