--- a/openpgl/CMakeLists.txt
+++ b/openpgl/CMakeLists.txt
@@ -77,7 +77,7 @@
 message(STATUS "Compiler: ${CMAKE_CXX_COMPILER_ID}")
 message(STATUS "Arch: ${CMAKE_SYSTEM_PROCESSOR}")
 
-if(WIN32)
+if(MSVC)
   # Here we chack for MSVC, or Clang pretending to be MSVC via Clang-CL
   if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC" OR (CMAKE_CXX_COMPILER_ID STREQUAL "Clang" AND CMAKE_CXX_SIMULATE_ID STREQUAL "MSVC"))
     set(OPENPGL_RELEASE_OPTIONS /Ox /Oi)  
