From 994a68c4f041e0cc277b49066845096dfbb82bf6 Mon Sep 17 00:00:00 2001 From: Mike Oliphant Date: Thu, 20 Feb 2025 12:38:26 -0800 Subject: [PATCH] detect clang properly even if it is running under MSVC --- src/CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 9e30716..e4819d6 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1,4 +1,4 @@ -if (MSVC) + if (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") add_compile_options( "$<$:/W4>" "$<$:/O2>" @@ -18,7 +18,7 @@ if (CMAKE_SYSTEM_PROCESSOR MATCHES "(amd64)|(AMD64)|(x86_64)") option(USE_NATIVE_ARCH "Enable architecture-specific optimizations" OFF) if (USE_NATIVE_ARCH) - if (MSVC) + if (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") add_compile_options(/arch:AVX2) message(STATUS "Enabling /arch:AVX2")