Skip to content

Commit 86a18fd

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 5297894 commit 86a18fd

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

unified-runtime/cmake/helpers.cmake

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,21 +196,37 @@ function(add_ur_library name)
196196
target_link_options(${name} PRIVATE
197197
$<$<STREQUAL:$<TARGET_LINKER_FILE_NAME:${name}>,link.exe>:LINKER:/DEPENDENTLOADFLAG:0x2000>
198198
)
199+
set_target_properties(${name} PROPERTIES DEBUG_POSTFIX d)
199200
endif()
200201
if(UR_EXTERNAL_DEPENDENCIES)
201202
add_dependencies(${name} ${UR_EXTERNAL_DEPENDENCIES})
202203
endif()
204+
add_dependencies(unified-runtime-libraries ${name})
203205
endfunction()
204206

207+
if(NOT TARGET unified-runtime-libraries)
208+
add_custom_target(unified-runtime-libraries)
209+
endif()
210+
205211
function(install_ur_library name)
206212
install(TARGETS ${name}
213+
COMPONENT unified-runtime
207214
EXPORT ${PROJECT_NAME}-targets
208215
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
209216
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
210-
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT unified-runtime
217+
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
211218
)
212219
endfunction()
213220

221+
if(NOT TARGET install-unified-runtime-libraries)
222+
add_custom_target(install-unified-runtime-libraries
223+
COMMAND ${CMAKE_COMMAND}
224+
-DCOMPONENT=unified-runtime
225+
-P ${CMAKE_BINARY_DIR}/cmake_install.cmake
226+
DEPENDS unified-runtime-libraries
227+
)
228+
endif()
229+
214230
include(FetchContent)
215231

216232
function(FetchSource GIT_REPOSITORY GIT_TAG GIT_DIR DEST)

0 commit comments

Comments
 (0)