@@ -466,8 +466,17 @@ function(_Boost_GUESS_COMPILER_PREFIX _ret)
466466 elseif (GHSMULTI)
467467 set (_boost_COMPILER "-ghs" )
468468 elseif ("x${CMAKE_CXX_COMPILER_ID} " STREQUAL "xMSVC" OR "x${CMAKE_CXX_SIMULATE_ID} " STREQUAL "xMSVC" )
469- if (MSVC_TOOLSET_VERSION GREATER_EQUAL 141)
470- set (_boost_COMPILER "-vc141;-vc140" )
469+ if (MSVC_TOOLSET_VERSION GREATER_EQUAL 150)
470+ # Not yet known.
471+ set (_boost_COMPILER "" )
472+ elseif (MSVC_TOOLSET_VERSION GREATER_EQUAL 140)
473+ # MSVC toolset 14.x versions are forward compatible.
474+ set (_boost_COMPILER "" )
475+ foreach (v 9 8 7 6 5 4 3 2 1 0)
476+ if (MSVC_TOOLSET_VERSION GREATER_EQUAL 14${v} )
477+ list (APPEND _boost_COMPILER "-vc14${v} " )
478+ endif ()
479+ endforeach ()
471480 elseif (MSVC_TOOLSET_VERSION GREATER_EQUAL 80)
472481 set (_boost_COMPILER "-vc${MSVC_TOOLSET_VERSION} " )
473482 elseif (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 13.10)
@@ -1083,9 +1092,15 @@ function(_Boost_UPDATE_WINDOWS_LIBRARY_SEARCH_DIRS_WITH_PREBUILT_PATHS component
10831092 else ()
10841093 set (_arch_suffix 32)
10851094 endif ()
1086- if (MSVC_TOOLSET_VERSION GREATER_EQUAL 141)
1087- list (APPEND ${componentlibvar} ${basedir} /lib${_arch_suffix} -msvc -14.1)
1088- list (APPEND ${componentlibvar} ${basedir} /lib${_arch_suffix} -msvc -14.0)
1095+ if (MSVC_TOOLSET_VERSION GREATER_EQUAL 150)
1096+ # Not yet known.
1097+ elseif (MSVC_TOOLSET_VERSION GREATER_EQUAL 140)
1098+ # MSVC toolset 14.x versions are forward compatible.
1099+ foreach (v 9 8 7 6 5 4 3 2 1 0)
1100+ if (MSVC_TOOLSET_VERSION GREATER_EQUAL 14${v} )
1101+ list (APPEND ${componentlibvar} ${basedir} /lib${_arch_suffix} -msvc -14.${v} )
1102+ endif ()
1103+ endforeach ()
10891104 elseif (MSVC_TOOLSET_VERSION GREATER_EQUAL 80)
10901105 math (EXPR _toolset_major_version "${MSVC_TOOLSET_VERSION} / 10" )
10911106 list (APPEND ${componentlibvar} ${basedir} /lib${_arch_suffix} -msvc -${_toolset_major_version} .0)
0 commit comments