Skip to content

Commit cf0e606

Browse files
committed
[UR] Add install target for Windows debug libs
This patch adds the `install-unified-runtime-libraries` target which installs only the runtime library subset of targets. This can be used to provide `ur_loaderd.dll` and `ur_adatper_<name>d.dll` which link against the multithreaded debug DLL C runtime by using the `DEBUG_POSTFIX` target property to append `d` to the library names.
1 parent 0f04f66 commit cf0e606

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

unified-runtime/cmake/helpers.cmake

+17-1
Original file line numberDiff line numberDiff line change
@@ -205,21 +205,37 @@ function(add_ur_library name)
205205
target_link_options(${name} PRIVATE
206206
$<$<STREQUAL:$<TARGET_LINKER_FILE_NAME:${name}>,link.exe>:LINKER:/DEPENDENTLOADFLAG:0x2000>
207207
)
208+
set_target_properties(${name} PROPERTIES DEBUG_POSTFIX d)
208209
endif()
209210
if(UR_EXTERNAL_DEPENDENCIES)
210211
add_dependencies(${name} ${UR_EXTERNAL_DEPENDENCIES})
211212
endif()
213+
add_dependencies(unified-runtime-libraries ${name})
212214
endfunction()
213215

216+
if(NOT TARGET unified-runtime-libraries)
217+
add_custom_target(unified-runtime-libraries)
218+
endif()
219+
214220
function(install_ur_library name)
215221
install(TARGETS ${name}
222+
COMPONENT unified-runtime
216223
EXPORT ${PROJECT_NAME}-targets
217224
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
218225
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
219-
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT unified-runtime
226+
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
220227
)
221228
endfunction()
222229

230+
if(NOT TARGET install-unified-runtime-libraries)
231+
add_custom_target(install-unified-runtime-libraries
232+
COMMAND ${CMAKE_COMMAND}
233+
-DCOMPONENT=unified-runtime
234+
-P ${CMAKE_BINARY_DIR}/cmake_install.cmake
235+
DEPENDS unified-runtime-libraries
236+
)
237+
endif()
238+
223239
include(FetchContent)
224240

225241
function(FetchSource GIT_REPOSITORY GIT_TAG GIT_DIR DEST)

0 commit comments

Comments
 (0)