Skip to content

Commit 623dca2

Browse files
cmake: remove all dead compiler-specific flag blocks from CMakeLists.txt
All compiler flag logic for MSVC, SunPro, Intel Classic (icl/icpc), and GCC was already migrated to the modern target-based mechanism in Installation/cmake/modules/CGAL_SetupCGALDependencies.cmake, which uses target_compile_options()/target_link_libraries() INTERFACE. The old blocks used uniquely_add_flags(CGAL_CXX_FLAGS ...) which is the obsolete global-variable approach. Removed dead blocks: - MSVC: /fp:strict, /fp:except-, /bigobj, _SCL_SECURE_NO_DEPRECATE, CMAKE_CXX_WARNING_LEVEL (all superseded by target_compile_options in CGAL_setup_CGAL_flags()) - SunPro: -features=extensions, -library=stlport4, -D_GNU_SOURCE, linker flags (superseded by target_compile_options + target_link_libraries in CGAL_setup_CGAL_flags()) - Intel Classic (icl/icpc): /fp:strict / -fp-model=strict, version check for < 11.0 (superseded; Intel < 11.0 from 2008 cannot support the C++17 that CGAL now requires) - GCC: -Wall for test suite, -frounding-math regex check, -g stripping from CMAKE_CXX_FLAGS, -mieee -mfp-rounding-mode=d for alpha (all superseded by target_compile_options in CGAL_setup_CGAL_flags()) The entire empty FLAGS section header is also removed. Closes #6923
1 parent b9ddbf2 commit 623dca2

File tree

1 file changed

+0
-91
lines changed

1 file changed

+0
-91
lines changed

Installation/CMakeLists.txt

Lines changed: 0 additions & 91 deletions
Original file line numberDiff line numberDiff line change
@@ -387,97 +387,6 @@ message(
387387
)
388388
message(STATUS "System: ${CMAKE_SYSTEM_NAME}")
389389

390-
#--------------------------------------------------------------------------------------------------
391-
#
392-
# -= FLAGS =-
393-
#
394-
#--------------------------------------------------------------------------------------------------
395-
396-
if(MSVC)
397-
398-
uniquely_add_flags(CGAL_CXX_FLAGS
399-
"-D_SCL_SECURE_NO_DEPRECATE;-D_SCL_SECURE_NO_WARNINGS")
400-
uniquely_add_flags(CGAL_CXX_FLAGS "/fp:strict")
401-
uniquely_add_flags(CGAL_CXX_FLAGS "/fp:except-")
402-
uniquely_add_flags(CGAL_CXX_FLAGS "/bigobj") # Use /bigobj by default
403-
404-
if(RUNNING_CGAL_AUTO_TEST OR CGAL_TEST_SUITE)
405-
set(CMAKE_CXX_WARNING_LEVEL
406-
2
407-
CACHE STRING "MSVC C++ compiler warning level" FORCE)
408-
mark_as_advanced(CMAKE_CXX_WARNING_LEVEL)
409-
endif()
410-
411-
endif()
412-
413-
if("\"${CMAKE_CXX_COMPILER_ID}\"" MATCHES "SunPro")
414-
message(STATUS "Using SunPro compiler, using STLPort 4.")
415-
416-
uniquely_add_flags(CGAL_CXX_FLAGS
417-
"-features=extensions;-library=stlport4;-D_GNU_SOURCE")
418-
uniquely_add_flags(CGAL_SHARED_LINKER_FLAGS "-library=stlport4")
419-
uniquely_add_flags(CGAL_EXE_LINKER_FLAGS "-library=stlport4")
420-
endif()
421-
422-
if("${CMAKE_CXX_COMPILER}" MATCHES "icl" OR "${CMAKE_CXX_COMPILER}" MATCHES
423-
"icpc")
424-
message(STATUS "Intel compiler is detected.")
425-
set(IntelCompiler_FOUND TRUE)
426-
427-
get_dependency_version(IntelCompiler)
428-
429-
if("${IntelCompiler_VERSION}" LESS "1100")
430-
message(
431-
"Intel Compiler version ${IntelCompiler_VERSION} is not supported by CGAL-${CGAL_MAJOR_VERSION}.${CGAL_MINOR_VERSION}! (too old, must be 11.0 or after)"
432-
)
433-
else()
434-
message(
435-
STATUS "Using Intel Compiler version 11 (or greater). Adding -fp-model=strict"
436-
)
437-
if(WIN32)
438-
uniquely_add_flags(CGAL_CXX_FLAGS "/fp:strict")
439-
else()
440-
uniquely_add_flags(CGAL_CXX_FLAGS "-fp-model=strict")
441-
endif()
442-
endif()
443-
endif()
444-
445-
if(CMAKE_COMPILER_IS_GNUCXX)
446-
447-
set(GCC_FOUND TRUE)
448-
449-
get_dependency_version(GCC)
450-
451-
if("${GCC_VERSION}" MATCHES "Not" OR "${GCC_VERSION}" MATCHES "Unknown")
452-
set(GCC_FOUND FALSE)
453-
endif()
454-
455-
if(GCC_FOUND)
456-
457-
if(RUNNING_CGAL_AUTO_TEST OR CGAL_TEST_SUITE)
458-
uniquely_add_flags(CGAL_CXX_FLAGS "-Wall")
459-
# Remove -g from the relevant CMAKE_CXX_FLAGS. This will also
460-
# propagate to the rest of the tests, since we overwrite those
461-
# flags with the ones used to build CGAL.
462-
string(REGEX REPLACE "-g( |$)" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
463-
# We only allow the release types DEBUG and RELEASE, but handle
464-
# all possible values just to be sure.
465-
foreach(release_type DEBUG RELEASE MINSIZEREL RELWITHDEBINFO)
466-
string(REGEX REPLACE "-g( |$)" "" CMAKE_CXX_FLAGS_${release_type}
467-
"${CMAKE_CXX_FLAGS_${release_type}}")
468-
endforeach()
469-
470-
endif()
471-
472-
if("${CMAKE_SYSTEM_PROCESSOR}" MATCHES "alpha")
473-
message(STATUS "Using gcc on alpha. Adding -mieee -mfp-rounding-mode=d")
474-
uniquely_add_flags(CGAL_CXX_FLAGS "-mieee -mfp-rounding-mode=d")
475-
endif()
476-
477-
endif()
478-
479-
endif()
480-
481390
if(CGAL_TEST_SUITE)
482391
include(display-third-party-libs-versions)
483392
endif()

0 commit comments

Comments
 (0)