diff --git a/math/vdt/tests/CMakeLists.txt b/math/vdt/tests/CMakeLists.txt index 384dcfa079516..b66b180e00a23 100644 --- a/math/vdt/tests/CMakeLists.txt +++ b/math/vdt/tests/CMakeLists.txt @@ -1,16 +1,21 @@ set (Libraries Core Hist Gpad MathCore) set (testname stressVdt) -if( "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" AND CLANG_MAJOR GREATER 3 AND CLANG_MINOR GREATER 8 ) - set (ModernClang True) + +if( CMAKE_COMPILER_IS_GNUCXX AND GCC_MAJOR GREATER 3 AND GCC_MINOR GREATER 6 ) + set (ModernGcc True) endif() -set(additional_compile_flags "-D__extern_always_inline=inline -O3") +if( "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" AND CLANG_MAJOR GREATER 2 AND CLANG_MINOR GREATER 3 ) + set (ModernClang True) + # __extern_always_inline is not understood by clang as of version 3.5 + set (alwaysInlineClang "-D__extern_always_inline=inline") +endif() -if( ModernClang ) - set(additional_compile_flags "${additional_compile_flags} -funsafe-math-optimizations -fno-trapping-math -ffinite-math-only") -else() - set(additional_compile_flags "${additional_compile_flags} -ffast-math") +if( ModernGcc ) + set(additional_compile_flags "-O3 -ffast-math") +elseif(ModernClang) + set(additional_compile_flags "-O3 -funsafe-math-optimizations -fno-trapping-math -ffinite-math-only ${alwaysInlineClang} ") endif() ROOT_EXECUTABLE(${testname} ${testname}.cxx LIBRARIES ${Libraries} ADDITIONAL_COMPILE_FLAGS ${additional_compile_flags} )