This repository was archived by the owner on Jul 22, 2026. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -162,11 +162,23 @@ if(MSVC)
162162 add_compile_options (/wd4267 /wd4244 /wd4127 /wd4324 )
163163endif ()
164164
165- if (NOT WIN32
166- OR (DEFINED CMAKE_C_COMPILER_FRONTEND_VARIANT
167- AND DEFINED CMAKE_CXX_COMPILER_FRONTEND_VARIANT
168- AND NOT CMAKE_C_COMPILER_FRONTEND_VARIANT STREQUAL "MSVC"
169- AND NOT CMAKE_CXX_COMPILER_FRONTEND_VARIANT STREQUAL "MSVC" ))
165+ get_filename_component (ITLABAI_C_COMPILER_NAME "${CMAKE_C_COMPILER } " NAME )
166+ get_filename_component (ITLABAI_CXX_COMPILER_NAME "${CMAKE_CXX_COMPILER } " NAME )
167+ string (TOLOWER "${ITLABAI_C_COMPILER_NAME} " ITLABAI_C_COMPILER_NAME_LOWER)
168+ string (TOLOWER "${ITLABAI_CXX_COMPILER_NAME} " ITLABAI_CXX_COMPILER_NAME_LOWER)
169+
170+ set (ITLABAI_WINDOWS_USES_MSVC_FRONTEND OFF )
171+ if (WIN32 AND (
172+ ITLABAI_C_COMPILER_NAME_LOWER MATCHES "(^|-)cl(\\ .exe)?$"
173+ OR ITLABAI_C_COMPILER_NAME_LOWER MATCHES "clang-cl(\\ .exe)?$"
174+ OR ITLABAI_C_COMPILER_NAME_LOWER MATCHES "icx-cl(\\ .exe)?$"
175+ OR ITLABAI_CXX_COMPILER_NAME_LOWER MATCHES "(^|-)cl(\\ .exe)?$"
176+ OR ITLABAI_CXX_COMPILER_NAME_LOWER MATCHES "clang-cl(\\ .exe)?$"
177+ OR ITLABAI_CXX_COMPILER_NAME_LOWER MATCHES "icx-cl(\\ .exe)?$" ))
178+ set (ITLABAI_WINDOWS_USES_MSVC_FRONTEND ON )
179+ endif ()
180+
181+ if (NOT WIN32 OR NOT ITLABAI_WINDOWS_USES_MSVC_FRONTEND)
170182 set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS } -Wall -Wextra -Werror" )
171183 set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS } -Wall -Wextra -Werror" )
172184else ()
You can’t perform that action at this time.
0 commit comments