Skip to content

Commit

Permalink
ENH: Drop support for MSVC toolset v141 aka Visual Studio 2017
Browse files Browse the repository at this point in the history
Enabling C++17 broke VS2017 due to its numerous bugs. See discussion:
https://discourse.itk.org/t/c-17-breaks-visual-studio-2017-drop-support/5884
  • Loading branch information
dzenanz committed May 2, 2023
1 parent a0c67bb commit 140f3c2
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 10 deletions.
4 changes: 2 additions & 2 deletions CMake/itkCompilerChecks.cmake
Expand Up @@ -18,8 +18,8 @@ endif ()

# Minimum compiler version check: Microsoft C/C++
if (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC" AND
CMAKE_CXX_COMPILER_VERSION VERSION_LESS 19.14)
message(FATAL_ERROR "Microsoft Visual Studio 2017 15.7 (MSVC 19.14) or later is required.")
CMAKE_CXX_COMPILER_VERSION VERSION_LESS 19.20)
message(FATAL_ERROR "Microsoft Visual Studio 2019 16.0 (MSVC 19.20) or later is required.")
endif ()

# Minimum compiler version check: Intel C++ (ICC)
Expand Down
3 changes: 1 addition & 2 deletions Documentation/SupportedCompilers.md
@@ -1,8 +1,7 @@
ITK requires a compiler with C++17 support.

# Visual Studio
* VS2015 and earlier: **NOT supported**
* MSVC toolset v141 (first shipped with VS2017): supported from VS2017 version 15.7
* VS2017 and earlier: **NOT supported**
* MSVC toolset v142 (first shipped with VS2019): supported
* MSVC toolset v143 (first shipped with VS2022): supported

Expand Down
9 changes: 3 additions & 6 deletions Modules/Core/Common/include/itkMacro.h
Expand Up @@ -151,14 +151,11 @@ namespace itk
#endif

/*
* ITK only supports MSVC++ 14.14 and greater
* MSVC++ 14.14 _MSC_VER == 1914 (Visual Studio 2017 version 15.7)
* MSVC++ 14.15 _MSC_VER == 1915 (Visual Studio 2017 version 15.8)
* MSVC++ 14.16 _MSC_VER == 1916 (Visual Studio 2017 version 15.9)
* ITK only supports MSVC++ 14.2 and greater
* MSVC++ 14.2 _MSC_VER == 1920 (Visual Studio 2019 Version 16.0)
*/
#if defined(_MSC_VER) && (_MSC_VER < 1914)
# error "MSVC version before Visual Studio 2017 version 15.7 is not supported under ITKv5.4"
#if defined(_MSC_VER) && (_MSC_VER < 1920)
# error "MSVC versions before Visual Studio 2019 are not supported under ITKv5.4"
#endif
#if defined(__SUNPRO_CC) && (__SUNPRO_CC < 0x5140)
# error "SUNPro C++ < 5.14.0 is not supported under ITKv5 and above"
Expand Down

1 comment on commit 140f3c2

@issakomi
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

BTW, toolset 141 is mentioned here too:

matrix:
v141:
CTEST_CMAKE_GENERATOR_TOOLSET: v141
CTEST_CMAKE_GENERATOR_PLATFORM: x64
CTEST_CONFIGURATION_TYPE: Release
CTEST_CMAKE_GENERATOR: "Visual Studio 16 2019"
imageName: 'windows-2019'

Please sign in to comment.