Merge pull request #2800 from jasjuang/master

prevent GCC flags propagating to NVCC, fixes #2775
This commit is contained in:
Laurent Rineau 2018-02-14 15:34:23 +01:00
commit 9a80f5ddd8
1 changed files with 5 additions and 1 deletions

View File

@ -136,7 +136,11 @@ function(CGAL_setup_CGAL_dependencies target)
endif()
if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 3)
message( STATUS "Using gcc version 4 or later. Adding -frounding-math" )
target_compile_options(${target} ${keyword} "-frounding-math")
if(CMAKE_VERSION VERSION_LESS 3.3)
target_compile_options(${target} ${keyword} "-frounding-math")
else()
target_compile_options(${target} ${keyword} "$<$<COMPILE_LANGUAGE:CXX>:-frounding-math>")
endif()
endif()
if ( "${GCC_VERSION}" MATCHES "^4.2" )
message( STATUS "Using gcc version 4.2. Adding -fno-strict-aliasing" )