@@ -49,10 +49,24 @@ function(add_sycl_rt_library LIB_NAME LIB_OBJ_NAME)
49
49
OpenCL-Headers
50
50
)
51
51
52
+ # Common link step setup
53
+
52
54
add_library (${LIB_NAME} SHARED
53
55
$< TARGET_OBJECTS:${LIB_OBJ_NAME} >
54
56
${CMAKE_CURRENT_BINARY_DIR} /version.rc )
55
57
58
+ find_package (Threads REQUIRED )
59
+
60
+ target_link_libraries (${LIB_NAME}
61
+ PRIVATE
62
+ ${CMAKE_DL_LIBS}
63
+ ${CMAKE_THREAD_LIBS_INIT}
64
+ $< $< NOT:$< BOOL:${WIN32} > > :UnifiedRuntimeLoader>
65
+ $< $< BOOL:${WIN32} > :shlwapi>
66
+ )
67
+
68
+ # Feature-specific compilation and link step setup
69
+
56
70
# Unlike for sycl library, for LLVMSupport we have only one version for a given build,
57
71
# so, we link LLVMSupport lib to matching sycl version only.
58
72
if (SYCL_ENABLE_STACK_PRINTING )
@@ -132,7 +146,6 @@ function(add_sycl_rt_library LIB_NAME LIB_OBJ_NAME)
132
146
endif ()
133
147
134
148
if (WIN32 )
135
- target_link_libraries (${LIB_NAME} PRIVATE shlwapi )
136
149
if (ARG_IMPLIB_NAME )
137
150
add_custom_command (
138
151
TARGET ${LIB_NAME} POST_BUILD
@@ -184,28 +197,6 @@ function(add_sycl_rt_library LIB_NAME LIB_OBJ_NAME)
184
197
target_compile_definitions (${LIB_OBJ_NAME} PRIVATE SYCL_EXT_JIT_ENABLE )
185
198
endif (SYCL_ENABLE_EXTENSION_JIT )
186
199
187
- find_package (Threads REQUIRED )
188
-
189
- target_link_libraries (${LIB_NAME}
190
- PRIVATE
191
- ${CMAKE_DL_LIBS}
192
- ${CMAKE_THREAD_LIBS_INIT}
193
- )
194
-
195
- # Link UR
196
- target_link_libraries (${LIB_NAME}
197
- PRIVATE
198
- UnifiedRuntime-Headers
199
- UnifiedRuntimeCommon
200
- )
201
-
202
- if (NOT WIN32 )
203
- target_link_libraries (${LIB_NAME}
204
- PRIVATE
205
- UnifiedRuntimeLoader
206
- )
207
- endif ()
208
-
209
200
add_common_options (${LIB_NAME} ${LIB_OBJ_NAME} )
210
201
211
202
set_target_properties (${LIB_NAME} PROPERTIES
0 commit comments