--- CMakeLists.txt.orig	2025-01-13 15:16:06 UTC
+++ CMakeLists.txt
@@ -513,8 +513,8 @@ string(TOLOWER "${CMAKE_BUILD_TYPE}" CMAKE_BUILD_TYPE_
   set(mi_basename "${mi_basename}-asan")
 endif()
 string(TOLOWER "${CMAKE_BUILD_TYPE}" CMAKE_BUILD_TYPE_LC)
-if(NOT(CMAKE_BUILD_TYPE_LC MATCHES "^(release|relwithdebinfo|minsizerel|none)$"))
-  set(mi_basename "${mi_basename}-${CMAKE_BUILD_TYPE_LC}") #append build type (e.g. -debug) if not a release version
+if(NOT(CMAKE_BUILD_TYPE_LC MATCHES "^(debug|release|relwithdebinfo|minsizerel|none)$"))
+  set(mi_basename "${mi_basename}-${CMAKE_BUILD_TYPE_LC}") #append build type if not a release version or debug
 endif()
 
 if(MI_BUILD_SHARED)
