Skip to content

Commit

Permalink
Fix stressvdt on mac
Browse files Browse the repository at this point in the history
  • Loading branch information
dpiparo committed Oct 19, 2016
1 parent 6b4f906 commit d7e3e2e
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions math/vdt/tests/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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} )
Expand Down

0 comments on commit d7e3e2e

Please sign in to comment.