@@ -47,6 +47,7 @@ option(UR_BUILD_ADAPTER_ALL "Build all currently supported adapters" OFF)
47
47
option (UR_BUILD_EXAMPLE_CODEGEN "Build the codegen example." OFF )
48
48
option (VAL_USE_LIBBACKTRACE_BACKTRACE "enable libbacktrace validation backtrace for linux" OFF )
49
49
option (UR_ENABLE_ASSERTIONS "Enable assertions for all build types" OFF )
50
+ option (UR_BUILD_XPTI_LIBS "Build the XPTI libraries when tracing is enabled" ON )
50
51
set (UR_DPCXX "" CACHE FILEPATH "Path of the DPC++ compiler executable" )
51
52
set (UR_DPCXX_BUILD_FLAGS "" CACHE STRING "Build flags to pass to DPC++ when compiling device programs" )
52
53
set (UR_SYCL_LIBRARY_DIR "" CACHE PATH
@@ -109,31 +110,34 @@ endif()
109
110
if (UR_ENABLE_TRACING )
110
111
add_compile_definitions (UR_ENABLE_TRACING )
111
112
112
- # fetch xpti proxy library for the tracing layer
113
- FetchContentSparse_Declare (xpti https://github.com/intel/llvm.git "sycl-nightly/20230703" "xpti" )
114
- FetchContent_MakeAvailable (xpti )
113
+ if (UR_BUILD_XPTI_LIBS )
114
+ # fetch xpti proxy library for the tracing layer
115
+ FetchContentSparse_Declare (xpti https://github.com/intel/llvm.git "sycl-nightly/20230703" "xpti" )
116
+ FetchContent_MakeAvailable (xpti )
115
117
116
- # set -fPIC for xpti since we are linking it with a shared library
117
- set_target_properties (xpti PROPERTIES POSITION_INDEPENDENT_CODE ON )
118
+ # set -fPIC for xpti since we are linking it with a shared library
119
+ set_target_properties (xpti PROPERTIES POSITION_INDEPENDENT_CODE ON )
118
120
119
- # fetch the xptifw dispatcher, mostly used for testing
120
- # these variables need to be set for xptifw to compile
121
- set (XPTI_SOURCE_DIR ${xpti_SOURCE_DIR} )
122
- set (XPTI_DIR ${xpti_SOURCE_DIR} )
123
- set (XPTI_ENABLE_TESTS OFF CACHE INTERNAL "Turn off xptifw tests" )
121
+ # fetch the xptifw dispatcher, mostly used for testing
122
+ # these variables need to be set for xptifw to compile
123
+ set (XPTI_SOURCE_DIR ${xpti_SOURCE_DIR} )
124
+ set (XPTI_DIR ${xpti_SOURCE_DIR} )
125
+ set (XPTI_ENABLE_TESTS OFF CACHE INTERNAL "Turn off xptifw tests" )
124
126
125
- FetchContentSparse_Declare (xptifw https://github.com/intel/llvm.git "sycl-nightly/20230703" "xptifw" )
127
+ FetchContentSparse_Declare (xptifw https://github.com/intel/llvm.git "sycl-nightly/20230703" "xptifw" )
126
128
127
- FetchContent_MakeAvailable (xptifw )
129
+ FetchContent_MakeAvailable (xptifw )
128
130
129
- check_cxx_compiler_flag ("-Wno-error=maybe-uninitialized" HAS_MAYBE_UNINIT )
130
- if (HAS_MAYBE_UNINIT )
131
- target_compile_options (xptifw PRIVATE -Wno-error=maybe-uninitialized )
131
+ check_cxx_compiler_flag ("-Wno-error=maybe-uninitialized" HAS_MAYBE_UNINIT )
132
+ if (HAS_MAYBE_UNINIT )
133
+ target_compile_options (xptifw PRIVATE -Wno-error=maybe-uninitialized )
134
+ endif ()
135
+
136
+ set_target_properties (xptifw PROPERTIES
137
+ LIBRARY_OUTPUT_DIRECTORY ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}
138
+ )
132
139
endif ()
133
140
134
- set_target_properties (xptifw PROPERTIES
135
- LIBRARY_OUTPUT_DIRECTORY ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}
136
- )
137
141
if (MSVC )
138
142
set (TARGET_XPTI $< IF:$< CONFIG:Release> ,xpti,xptid> )
139
143
else ()
0 commit comments