Skip to content
This repository was archived by the owner on Mar 28, 2023. It is now read-only.

Commit bc5e945

Browse files
authored
[cmake] validate CHECK_SYCL_ALL more thoroughly during configuration (#1321)
I had a bit of trouble working out why lit was failing to start after configuration had succceeded. Turns out I was passing a partial tuple to cmake `-DCHECK_SYCL_ALL` due to a typo in a shell variable. This patch verifies that both parts of each tuple in the `CHECK_SYCL_ALL` variable are nonempty and terminates configuration with an error message otherwise, which should make it a bit more obvious what's happening.
1 parent a5a41f4 commit bc5e945

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

SYCL/CMakeLists.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,13 @@ if(CHECK_SYCL_ALL)
1515
list (GET BE_LIST 0 TARGET_BE)
1616
list (GET BE_LIST 1 TARGET_DEVICES)
1717

18+
if ("${TARGET_BE}" STREQUAL "")
19+
message(FATAL_ERROR
20+
"invalid empty target backend specification in CHECK_SYCL_ALL")
21+
elseif("${TARGET_DEVICES}" STREQUAL "")
22+
message(FATAL_ERROR
23+
"invalid empty target device specification in CHECK_SYCL_ALL")
24+
endif()
1825
message("Run on ${TARGET_DEVICES} for ${TARGET_BE}")
1926

2027
string(REPLACE "," "_" TARGET check-sycl-${TARGET_BE}-${TARGET_DEVICES})

0 commit comments

Comments
 (0)