Skip to content

Commit 9dd4283

Browse files
committed
cmake: fix MSVC check
1 parent 10c688e commit 9dd4283

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

CMakeLists.txt

+9-8
Original file line numberDiff line numberDiff line change
@@ -157,15 +157,16 @@ elseif(APPLE)
157157
message(STATUS "RPATH support: ${CMAKE_MACOSX_RPATH}")
158158

159159
elseif (WIN32)
160-
if(NOT VS2015 AND NOT VS2017 AND NOT VS2019)
161-
message(FATAL_ERROR "You must use Microsoft Visual Studio 2015, 2017 or 2019 as compiler")
160+
if(C_MSVC)
161+
if (NOT VS2015 AND NOT VS2017 AND NOT VS2019)
162+
message(FATAL_ERROR "You must use Microsoft Visual Studio 2015, 2017 or 2019 as compiler")
163+
else()
164+
# compile with full multicore
165+
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /MP")
166+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MP")
167+
set(CUSTOM_SHELL_BIN "")
168+
endif()
162169
endif()
163-
164-
# compile with full multicore
165-
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /MP")
166-
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MP")
167-
168-
set(CUSTOM_SHELL_BIN "")
169170
endif()
170171

171172
if (C_CLANG OR C_GCC)

0 commit comments

Comments
 (0)