CMakeLists: Create test targets only if HIP install location is writable
Change-Id: I79f28884b0f117f2824ca8877c25b586bce62e5b
[ROCm/hip commit: aca015c47d]
Tento commit je obsažen v:
@@ -369,19 +369,26 @@ endif()
|
||||
# Target: test
|
||||
set(HIP_PATH ${CMAKE_INSTALL_PREFIX})
|
||||
set(HIP_SRC_PATH ${CMAKE_CURRENT_SOURCE_DIR})
|
||||
execute_process(COMMAND "${CMAKE_COMMAND}" -E copy_directory "${HIP_SRC_PATH}/cmake" "${HIP_PATH}/cmake")
|
||||
execute_process(COMMAND "${CMAKE_COMMAND}" -E copy_directory "${HIP_SRC_PATH}/bin" "${HIP_PATH}/bin")
|
||||
set(CMAKE_MODULE_PATH "${HIP_PATH}/cmake" ${CMAKE_MODULE_PATH})
|
||||
include(${HIP_SRC_PATH}/tests/hit/HIT.cmake)
|
||||
execute_process(COMMAND "${CMAKE_COMMAND}" -E copy_directory "${HIP_SRC_PATH}/cmake" "${HIP_PATH}/cmake" RESULT_VARIABLE RUN_HIT ERROR_QUIET)
|
||||
if(${RUN_HIT} EQUAL 0)
|
||||
execute_process(COMMAND "${CMAKE_COMMAND}" -E copy_directory "${HIP_SRC_PATH}/bin" "${HIP_PATH}/bin" RESULT_VARIABLE RUN_HIT ERROR_QUIET)
|
||||
endif()
|
||||
if(${RUN_HIT} EQUAL 0)
|
||||
set(CMAKE_MODULE_PATH "${HIP_PATH}/cmake" ${CMAKE_MODULE_PATH})
|
||||
include(${HIP_SRC_PATH}/tests/hit/HIT.cmake)
|
||||
|
||||
# Add tests
|
||||
include_directories(${HIP_SRC_PATH}/tests/src)
|
||||
hit_add_directory_recursive(${HIP_SRC_PATH}/tests/src "directed_tests")
|
||||
# Add tests
|
||||
include_directories(${HIP_SRC_PATH}/tests/src)
|
||||
hit_add_directory_recursive(${HIP_SRC_PATH}/tests/src "directed_tests")
|
||||
|
||||
# Add top-level tests to build_tests
|
||||
add_custom_target(build_tests DEPENDS directed_tests)
|
||||
# Add top-level tests to build_tests
|
||||
add_custom_target(build_tests DEPENDS directed_tests)
|
||||
|
||||
# Add custom target: check
|
||||
add_custom_target(check COMMAND "${CMAKE_COMMAND}" --build . --target test DEPENDS build_tests)
|
||||
else()
|
||||
message(STATUS "Testing targets will not be available. To enable them please ensure that the HIP installation directory is writeable. Use -DCMAKE_INSTALL_PREFIX to specify a suitable location")
|
||||
endif()
|
||||
|
||||
# Add custom target: check
|
||||
add_custom_target(check COMMAND "${CMAKE_COMMAND}" --build . --target test DEPENDS build_tests)
|
||||
|
||||
# vim: ts=4:sw=4:expandtab:smartindent
|
||||
|
||||
Odkázat v novém úkolu
Zablokovat Uživatele