diff --git a/sycl/cmake/modules/AddSYCLUnitTest.cmake b/sycl/cmake/modules/AddSYCLUnitTest.cmake index 5c08607d62b95..3d6bb6301d77d 100644 --- a/sycl/cmake/modules/AddSYCLUnitTest.cmake +++ b/sycl/cmake/modules/AddSYCLUnitTest.cmake @@ -6,7 +6,8 @@ macro(add_sycl_unittest test_dirname link_variant) # Enable exception handling for these unit tests set(LLVM_REQUIRES_EH 1) - if (MSVC AND CMAKE_BUILD_TYPE MATCHES "Debug") + string(TOLOWER "${CMAKE_BUILD_TYPE}" build_type_lower) + if (MSVC AND build_type_lower MATCHES "debug") set(sycl_obj_target "sycld_object") set(sycl_so_target "sycld") else()