Skip to content

Commit ddea669

Browse files
[SYCL][NFC] Cleanup SYCL RT CMakeLists [1/N] (#17387)
This is one patch in a series intended to re-organize `add_sycl_rt_library` helper function to make it shorter and simpler. Cleaned up `add_dependencies` calls: - UR adapters are linked with UMF, there is an implicit dependency already - `LIB_OBJ_NAME` is an `OBJECT` library, it is not linked to anything and therefore should not have any dependencies except for header files Ideally, we should not have any `add_dependencies` calls, but due to dynamic loading mechanisms used everywhere, we need those dependencies set explicitly to ensure that everything is re-built correctly.
1 parent a2ce959 commit ddea669

File tree

3 files changed

+2
-6
lines changed

3 files changed

+2
-6
lines changed

sycl/source/CMakeLists.txt

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -185,8 +185,6 @@ function(add_sycl_rt_library LIB_NAME LIB_OBJ_NAME)
185185
"${UNIFIED_RUNTIME_COMMON_INCLUDE_DIR}"
186186
)
187187

188-
add_dependencies(${LIB_OBJ_NAME} UnifiedRuntimeAdapters ur_umf)
189-
190188
target_link_libraries(${LIB_NAME}
191189
PRIVATE
192190
UnifiedRuntime-Headers
@@ -198,8 +196,6 @@ function(add_sycl_rt_library LIB_NAME LIB_OBJ_NAME)
198196
PRIVATE
199197
UnifiedRuntimeLoader
200198
)
201-
else()
202-
add_dependencies(${LIB_NAME} UnifiedRuntimeLoader)
203199
endif()
204200

205201
target_include_directories(${LIB_NAME}
@@ -208,8 +204,6 @@ function(add_sycl_rt_library LIB_NAME LIB_OBJ_NAME)
208204
"${UNIFIED_RUNTIME_COMMON_INCLUDE_DIR}"
209205
)
210206

211-
add_dependencies(${LIB_NAME} UnifiedRuntimeAdapters ur_umf)
212-
213207
add_common_options(${LIB_NAME} ${LIB_OBJ_NAME})
214208

215209
set_target_properties(${LIB_NAME} PROPERTIES

sycl/ur_win_proxy_loader/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ set_property(SOURCE ${CMAKE_CURRENT_BINARY_DIR}/versioninfo.rc
1212
"RC_COPYRIGHT=\"Copyright (C) 2023 Intel Corporation\"")
1313
configure_file(../../llvm/resources/windows_version_resource.rc ${CMAKE_CURRENT_BINARY_DIR}/versioninfo.rc @ONLY)
1414
add_library(ur_win_proxy_loader SHARED ur_win_proxy_loader.cpp ${CMAKE_CURRENT_BINARY_DIR}/versioninfo.rc)
15+
add_dependencies(ur_win_proxy_loader UnifiedRuntimeLoader)
1516
install(TARGETS ur_win_proxy_loader
1617
RUNTIME DESTINATION "bin" COMPONENT ur_win_proxy_loader
1718
)

unified-runtime/source/adapters/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ function(add_ur_adapter name)
2626
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/../adapter.map.in ${ADAPTER_VERSION_SCRIPT} @ONLY)
2727
target_link_options(${name} PRIVATE "-Wl,--version-script=${ADAPTER_VERSION_SCRIPT}")
2828
endif()
29+
add_dependencies(ur_loader ${name})
2930
endfunction()
3031

3132
add_subdirectory(mock)

0 commit comments

Comments
 (0)