Skip to content

Commit 80d02e7

Browse files
author
Alexander Batashev
authored
[SYCL] Fix linkage of sycl-ls for Debug Windows builds (#4204)
MSVC distinguishes debug and release versions of STL. Link with the correct library to avoid crashes.
1 parent d799c48 commit 80d02e7

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

sycl/tools/sycl-ls/CMakeLists.txt

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,16 @@
11
add_executable(sycl-ls sycl-ls.cpp)
22
add_dependencies(sycl-ls sycl)
33
target_include_directories(sycl-ls PRIVATE "${sycl_inc_dir}")
4+
5+
set(sycl_lib sycl)
6+
string(TOLOWER "${CMAKE_BUILD_TYPE}" build_type_lower)
7+
if (WIN32 AND "${build_type_lower}" MATCHES "debug")
8+
set(sycl_lib sycld)
9+
endif()
10+
411
target_link_libraries(sycl-ls
512
PRIVATE
6-
sycl
13+
${sycl_lib}
714
OpenCL-Headers
815
)
916
install(TARGETS sycl-ls

0 commit comments

Comments
 (0)