Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use TARGET_RUNTIME_DLLS generator expression #739

Draft
wants to merge 8 commits into
base: develop
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ option(BUILD_ADDRESS_SANITIZER "Build with address sanitizer enabled" OFF)
option(BUILD_CODE_COVERAGE "Build rocSOLVER with code coverage enabled" OFF)
option(WERROR "Treat warnings as errors" OFF)
option(BUILD_COMPRESSED_DBG "Enable compressed debug symbols" ON)
cmake_dependent_option(BUILD_COPY_TEST_DEPS "Copy test dependencies to the clients build directory" ON "WIN32;CMAKE_VERSION VERSION_GREATER_EQUAL 3.21" OFF)

cmake_dependent_option(BUILD_FILE_REORG_BACKWARD_COMPATIBILITY
"Build with file/folder reorg backward compatibility enabled" OFF "NOT WIN32" OFF)
Expand Down
40 changes: 20 additions & 20 deletions clients/gtest/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -150,29 +150,29 @@ add_executable(rocsolver-test

add_armor_flags(rocsolver-test "${ARMOR_LEVEL}")

if(WIN32)
file(GLOB third_party_dlls
LIST_DIRECTORIES OFF
CONFIGURE_DEPENDS
${ROCSOLVER_LAPACK_PATH}/bin/*.dll
${GTest_DIR}/bin/*.dll
$ENV{rocblas_DIR}/bin/*.dll
$ENV{HIP_DIR}/bin/*.dll
$ENV{HIP_DIR}/bin/hipinfo.exe
${CMAKE_SOURCE_DIR}/rtest.*
if(BUILD_COPY_TEST_DEPS)
add_custom_command(TARGET rocsolver-test POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_RUNTIME_DLLS:rocsolver-test> $<TARGET_FILE_DIR:rocsolver-test>
COMMAND_EXPAND_LISTS
)
foreach(file_i ${third_party_dlls})
add_custom_command(TARGET rocsolver-test
POST_BUILD
COMMAND ${CMAKE_COMMAND}
ARGS -E copy ${file_i} ${PROJECT_BINARY_DIR}/staging/

get_target_property(rocblas_location roc::rocblas LOCATION)
get_filename_component(rocblas_directory ${rocblas_location} DIRECTORY)
add_custom_command(TARGET rocsolver-test POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_directory ${rocblas_directory}/rocblas/library $<TARGET_FILE_DIR:rocsolver-test>/library
)

find_program(HIPINFO_EXECUTABLE hipinfo PATHS $ENV{HIP_DIR}/bin)
set(test_files
${HIPINFO_EXECUTABLE}
${CMAKE_CURRENT_SOURCE_DIR}/../../rtest.py
${CMAKE_CURRENT_SOURCE_DIR}/../../rtest.xml
)
foreach(file_i ${runtime_files})
add_custom_command(TARGET rocsolver-test POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy ${file_i} $<TARGET_FILE_DIR:rocsolver-test>
)
endforeach()
add_custom_command(TARGET rocsolver-test
POST_BUILD
COMMAND ${CMAKE_COMMAND}
ARGS -E copy_directory $ENV{rocblas_DIR}/bin/rocblas/library ${PROJECT_BINARY_DIR}/staging/library
)
endif()

target_link_libraries(rocsolver-test PRIVATE
Expand Down