Skip to content

Commit 7be47bb

Browse files
Remove dead MSVC version fallbacks in CGAL_GeneratorSpecificSettings.cmake
Remove the dead elseif(MSVC14) through elseif(MSVC71) fallback chain. These are unreachable because CGAL requires CMake >= 3.15, which always defines MSVC_TOOLSET_VERSION for any MSVC build. Additionally, CGAL requires C++17, which needs VS 2017+ at minimum. Add an explicit elseif(MSVC) branch with AUTHOR_WARNING for the edge case where MSVC is detected but MSVC_TOOLSET_VERSION is unexpectedly empty, so it fails loudly instead of silently skipping toolset config. The else() branch preserves the status message for non-MSVC compilers.
1 parent b3cb16c commit 7be47bb

File tree

1 file changed

+5
-21
lines changed

1 file changed

+5
-21
lines changed

Installation/cmake/modules/CGAL_GeneratorSpecificSettings.cmake

Lines changed: 5 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -11,27 +11,11 @@ if ( NOT CGAL_GENERATOR_SPECIFIC_SETTINGS_FILE_INCLUDED )
1111
if ( MSVC_TOOLSET_VERSION )
1212
set(CGAL_TOOLSET "vc${MSVC_TOOLSET_VERSION}")
1313
message( STATUS "Using VC toolset ${MSVC_TOOLSET_VERSION}." )
14-
elseif ( MSVC14 )
15-
set(CGAL_TOOLSET "vc140")
16-
message( STATUS "Using VC14 compiler." )
17-
elseif ( MSVC12 )
18-
set(CGAL_TOOLSET "vc120")
19-
message( STATUS "Using VC12 compiler." )
20-
elseif ( MSVC11 )
21-
set(CGAL_TOOLSET "vc110")
22-
message( STATUS "Using VC11 compiler." )
23-
elseif ( MSVC10 )
24-
set(CGAL_TOOLSET "vc100")
25-
message( STATUS "Using VC10 compiler." )
26-
elseif ( MSVC90 )
27-
set(CGAL_TOOLSET "vc90")
28-
message( STATUS "Using VC90 compiler." )
29-
elseif ( MSVC80 )
30-
set(CGAL_TOOLSET "vc80")
31-
message( STATUS "Using VC80 compiler." )
32-
elseif ( MSVC71 )
33-
set(CGAL_TOOLSET "vc71")
34-
message( STATUS "Using VC71 compiler." )
14+
elseif ( MSVC )
15+
message( AUTHOR_WARNING
16+
"MSVC detected but MSVC_TOOLSET_VERSION is not set. "
17+
"CGAL_TOOLSET will not be configured. "
18+
"This may indicate an unsupported CMake version or toolchain." )
3519
else()
3620
message( STATUS "Using ${CMAKE_CXX_COMPILER} compiler." )
3721
endif()

0 commit comments

Comments
 (0)