prevent GCC flags propagating to NVCC, fixes #2775

This commit is contained in:
jasjuang 2018-02-09 09:46:50 -08:00
parent 070f661244
commit de47e36dac
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" )