From de47e36dac9a1513da2c279125fde000e1a1cc5b Mon Sep 17 00:00:00 2001 From: jasjuang Date: Fri, 9 Feb 2018 09:46:50 -0800 Subject: [PATCH] prevent GCC flags propagating to NVCC, fixes #2775 --- Installation/cmake/modules/CGAL_SetupCGALDependencies.cmake | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Installation/cmake/modules/CGAL_SetupCGALDependencies.cmake b/Installation/cmake/modules/CGAL_SetupCGALDependencies.cmake index 15e4ae597f8..e32b729b85f 100644 --- a/Installation/cmake/modules/CGAL_SetupCGALDependencies.cmake +++ b/Installation/cmake/modules/CGAL_SetupCGALDependencies.cmake @@ -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} "$<$:-frounding-math>") + endif() endif() if ( "${GCC_VERSION}" MATCHES "^4.2" ) message( STATUS "Using gcc version 4.2. Adding -fno-strict-aliasing" )