--- CMakeLists.txt	2025-04-27 02:17:42.000000000 +0800
+++ CMakeLists.txt	2026-04-30 19:01:07.000000000 +0800
@@ -79,7 +79,7 @@
   endif()
 endif()
 
-if("$ENV{MACOSX_DEPLOYMENT_TARGET}" STREQUAL "10.11")
+if(CMAKE_CXX_COMPILER_ID MATCHES "Clang" AND "$ENV{MACOSX_DEPLOYMENT_TARGET}" LESS "10.12")
   add_compile_options(-DVARIANT_COMPAT)
 endif()
 
