@@ -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_SYCL_LIBRARY_DIR "" CACHE PATH
52
53
"Path of the SYCL runtime library directory" )
@@ -107,31 +108,34 @@ endif()
107
108
if (UR_ENABLE_TRACING )
108
109
add_compile_definitions (UR_ENABLE_TRACING )
109
110
110
- # fetch xpti proxy library for the tracing layer
111
- FetchContentSparse_Declare (xpti https://github.com/intel/llvm.git "sycl-nightly/20230703" "xpti" )
112
- FetchContent_MakeAvailable (xpti )
111
+ if (UR_BUILD_XPTI_LIBS )
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
115
114
- # set -fPIC for xpti since we are linking it with a shared library
115
- set_target_properties (xpti PROPERTIES POSITION_INDEPENDENT_CODE ON )
116
+ # set -fPIC for xpti since we are linking it with a shared library
117
+ set_target_properties (xpti PROPERTIES POSITION_INDEPENDENT_CODE ON )
116
118
117
- # fetch the xptifw dispatcher, mostly used for testing
118
- # these variables need to be set for xptifw to compile
119
- set (XPTI_SOURCE_DIR ${xpti_SOURCE_DIR} )
120
- set (XPTI_DIR ${xpti_SOURCE_DIR} )
121
- set (XPTI_ENABLE_TESTS OFF CACHE INTERNAL "Turn off xptifw tests" )
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" )
122
124
123
- FetchContentSparse_Declare (xptifw https://github.com/intel/llvm.git "sycl-nightly/20230703" "xptifw" )
125
+ FetchContentSparse_Declare (xptifw https://github.com/intel/llvm.git "sycl-nightly/20230703" "xptifw" )
124
126
125
- FetchContent_MakeAvailable (xptifw )
127
+ FetchContent_MakeAvailable (xptifw )
126
128
127
- check_cxx_compiler_flag ("-Wno-error=maybe-uninitialized" HAS_MAYBE_UNINIT )
128
- if (HAS_MAYBE_UNINIT )
129
- target_compile_options (xptifw PRIVATE -Wno-error=maybe-uninitialized )
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 )
132
+ endif ()
133
+
134
+ set_target_properties (xptifw PROPERTIES
135
+ LIBRARY_OUTPUT_DIRECTORY ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}
136
+ )
130
137
endif ()
131
138
132
- set_target_properties (xptifw PROPERTIES
133
- LIBRARY_OUTPUT_DIRECTORY ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}
134
- )
135
139
if (MSVC )
136
140
set (TARGET_XPTI $< IF:$< CONFIG:Release> ,xpti,xptid> )
137
141
else ()
0 commit comments