Skip to content

Commit 534bfc7

Browse files
committed
add _hip_subproject_names to build hip-tests
1 parent 0756f53 commit 534bfc7

File tree

1 file changed

+28
-18
lines changed

1 file changed

+28
-18
lines changed

core/CMakeLists.txt

Lines changed: 28 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,8 @@ if(THEROCK_ENABLE_HIP_RUNTIME)
7777
##############################################################################
7878
set(HIP_CLR_CMAKE_ARGS)
7979
set(HIP_CLR_RUNTIME_DEPS)
80+
set(_hip_subproject_names)
81+
8082
if(WIN32)
8183
# Windows CLR options
8284
set(_compute_pal_dir "${THEROCK_ROCM_SYSTEMS_SOURCE_DIR}/shared/amdgpu-windows-interop")
@@ -133,6 +135,31 @@ if(THEROCK_ENABLE_HIP_RUNTIME)
133135
therock_cmake_subproject_provide_package(hip-clr hip-lang lib/cmake/hip-lang)
134136
therock_cmake_subproject_provide_package(hip-clr hiprtc lib/cmake/hiprtc)
135137
therock_cmake_subproject_activate(hip-clr)
138+
list(APPEND _hip_subproject_names hip-clr)
139+
140+
if(THEROCK_BUILD_TESTING)
141+
therock_cmake_subproject_declare(hip-tests
142+
USE_DIST_AMDGPU_TARGETS
143+
EXTERNAL_SOURCE_DIR "${THEROCK_ROCM_SYSTEMS_SOURCE_DIR}/projects/hip-tests"
144+
BINARY_DIR "${CMAKE_CURRENT_BINARY_DIR}/hip-tests"
145+
CMAKE_LISTS_RELPATH "catch"
146+
LOGICAL_TARGET_NAME build_tests
147+
BACKGROUND_BUILD
148+
CMAKE_ARGS
149+
"-DHIP_PLATFORM=amd"
150+
"-DROCM_PATH="
151+
COMPILER_TOOLCHAIN
152+
amd-hip
153+
BUILD_DEPS
154+
rocm-cmake
155+
therock-catch2
156+
RUNTIME_DEPS
157+
hip-clr
158+
)
159+
therock_cmake_subproject_glob_c_sources(hip-tests SUBDIRS .)
160+
therock_cmake_subproject_activate(hip-tests)
161+
list(APPEND _hip_subproject_names hip-tests)
162+
endif(THEROCK_BUILD_TESTING)
136163

137164
therock_provide_artifact(core-hip
138165
TARGET_NEUTRAL
@@ -144,7 +171,7 @@ if(THEROCK_ENABLE_HIP_RUNTIME)
144171
lib
145172
run
146173
SUBPROJECT_DEPS
147-
hip-clr
174+
${_hip_subproject_names}
148175
)
149176

150177
therock_test_validate_shared_lib(
@@ -155,23 +182,6 @@ if(THEROCK_ENABLE_HIP_RUNTIME)
155182
libhiprtc.so
156183
)
157184

158-
if(THEROCK_BUILD_TESTING)
159-
therock_cmake_subproject_declare(hip-tests
160-
USE_DIST_AMDGPU_TARGETS
161-
EXTERNAL_SOURCE_DIR "${THEROCK_ROCM_SYSTEMS_SOURCE_DIR}/projects/hip-tests"
162-
BINARY_DIR "${CMAKE_CURRENT_BINARY_DIR}/hip-tests"
163-
CMAKE_LISTS_RELPATH "catch"
164-
LOGICAL_TARGET_NAME build_tests
165-
BACKGROUND_BUILD
166-
CMAKE_ARGS
167-
"-DHIP_PLATFORM=amd"
168-
RUNTIME_DEPS
169-
hip-clr
170-
)
171-
therock_cmake_subproject_glob_c_sources(hip-tests SUBDIRS .)
172-
therock_cmake_subproject_activate(hip-tests)
173-
endif(THEROCK_BUILD_TESTING)
174-
175185
if(WIN32)
176186
##############################################################################
177187
# hipInfo (from hip-tests)

0 commit comments

Comments
 (0)