diff --git a/sycl/unittests/CMakeLists.txt b/sycl/unittests/CMakeLists.txt index 543f17b8d0687..1199e4e7ba9d8 100644 --- a/sycl/unittests/CMakeLists.txt +++ b/sycl/unittests/CMakeLists.txt @@ -1,6 +1,12 @@ add_custom_target(SYCLUnitTests) set_target_properties(SYCLUnitTests PROPERTIES FOLDER "SYCL tests") +foreach(flag_var + CMAKE_CXX_FLAGS CMAKE_CXX_FLAGS_DEBUG CMAKE_CXX_FLAGS_RELEASE + CMAKE_CXX_FLAGS_MINSIZEREL CMAKE_CXX_FLAGS_RELWITHDEBINFO) +string(REGEX REPLACE "/MT" "/MD" ${flag_var} "${${flag_var}}") +endforeach() + # add_sycl_unittest(test_dirname SHARED|OBJECT file1.cpp, file2.cpp ...) # # Will compile the list of files together and link against SYCL.