Commit 5417bd32 authored by Jan Möbius's avatar Jan Möbius
Browse files

Merge branch 'clang-no-frounding-math' into 'master'

Don't call clang++ with unsupported -frounding-math.

This avoids a flood of warnings, and CGAL only needs -frounding-math
when compiling with GCC.

See merge request !173
parents d46f1884 aece4895
Pipeline #3314 passed with stage
in 62 minutes and 25 seconds
......@@ -40,6 +40,11 @@ ENDIF( NOT APPLE )
MARK_AS_ADVANCED(CGAL_INCLUDE_DIR)
if ("${CMAKE_CXX_COMPILER} ${CMAKE_CXX_COMPILER_ARG1}" MATCHES ".*clang.*")
SET(CXX_IS_CLANG true)
else()
SET(CXX_IS_CLANG false)
endif()
# Copy the results to the output variables.
IF(CGAL_INCLUDE_DIR )
......@@ -73,8 +78,10 @@ IF(CGAL_INCLUDE_DIR )
DOC "Directory containing the CGAL library"
)
list ( APPEND CGAL_LIBRARIES CGAL CGAL_Core CGAL_ImageIO mpfr )
set (CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -frounding-math")
set (CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -frounding-math")
if (NOT CXX_IS_CLANG)
set (CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -frounding-math")
set (CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -frounding-math")
endif()
ELSE( WIN32 )
find_path(CGAL_LIBRARY_DIR
......@@ -83,8 +90,9 @@ IF(CGAL_INCLUDE_DIR )
DOC "Directory containing the CGAL library"
)
list ( APPEND CGAL_LIBRARIES CGAL CGAL_Core CGAL_ImageIO)
set (CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -frounding-math")
set (CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -frounding-math")
if (NOT CXX_IS_CLANG)
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -frounding-math")
endif()
# This is needed to link correctly against lapack
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment