Skip to content

Commit 5cb4647

Browse files
authored
[UR] Ensure mock target depends on UR_EXTERNAL_DEPENDENCIES (#18844)
Firstly, rename `ur_mock_headers` to `ur_mock` as this is a shared library not header only library. Secondly, when part of a subbuild, ensure that the `ur_mock` target depends on the specified `UR_EXTERNAL_DEPENDENCIES`, this is handled by using `add_ur_library()` in place of `add_library()`.
1 parent 32c6376 commit 5cb4647

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

unified-runtime/scripts/check-hardening.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ for file in $1/lib/*.so; do
2828
*/libOpenCL*)
2929
# This is not built as part of UR
3030
true;;
31-
*/libzeCallMap.so | */libur_mock_headers.so)
31+
*/libzeCallMap.so | */libur_mock.so)
3232
# Only used in testing, and are too simple for many of the hardening flags to have an effect.
3333
true;;
3434
*)

unified-runtime/source/mock/CMakeLists.txt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@
33
# See LICENSE.TXT
44
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
55

6-
add_library (ur_mock_headers SHARED
7-
"${CMAKE_CURRENT_SOURCE_DIR}/ur_mock_helpers.cpp")
8-
9-
target_include_directories(ur_mock_headers
6+
add_ur_library(ur_mock SHARED
7+
"${CMAKE_CURRENT_SOURCE_DIR}/ur_mock_helpers.cpp"
8+
)
9+
target_include_directories(ur_mock
1010
INTERFACE "${CMAKE_CURRENT_SOURCE_DIR}"
1111
)
1212

13-
target_link_libraries(ur_mock_headers PRIVATE
13+
target_link_libraries(ur_mock PRIVATE
1414
${PROJECT_NAME}::headers
1515
)
1616

17-
add_library(${PROJECT_NAME}::mock ALIAS ur_mock_headers)
17+
add_library(${PROJECT_NAME}::mock ALIAS ur_mock)

0 commit comments

Comments
 (0)