From fac56bb935de5a808b197ccc4a886f262d94dc99 Mon Sep 17 00:00:00 2001 From: worktycho Date: Fri, 7 Mar 2014 16:55:45 +0000 Subject: Enabled -ffast-math --- SetFlags.cmake | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'SetFlags.cmake') diff --git a/SetFlags.cmake b/SetFlags.cmake index ded57e6d7..6e86ac0aa 100644 --- a/SetFlags.cmake +++ b/SetFlags.cmake @@ -1,5 +1,4 @@ - macro (add_flags_lnk FLAGS) set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${FLAGS}") set(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} ${FLAGS}") @@ -50,6 +49,9 @@ macro(set_flags) else() add_flags_cxx("-pthread") endif() + + #we support non-IEEE 754 fpus so can make no guarentees about error + add_flags_cxx("-ffast-math") else() # Let gcc / clang know that we're compiling a multi-threaded app: @@ -62,6 +64,9 @@ macro(set_flags) # We use a signed char (fixes #640 on RasPi) add_flags_cxx("-fsigned-char") + + #we support non-IEEE 754 fpus so can make no guarentees about error + add_flags_cxx("-ffast-math") endif() -- cgit v1.2.3 From 2a3d8d46ec5d269b220ed1fb711cb4d2bfa9dfeb Mon Sep 17 00:00:00 2001 From: worktycho Date: Fri, 7 Mar 2014 17:04:38 +0000 Subject: Only use fast-math in exes --- SetFlags.cmake | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'SetFlags.cmake') diff --git a/SetFlags.cmake b/SetFlags.cmake index 6e86ac0aa..a5bd3a0a2 100644 --- a/SetFlags.cmake +++ b/SetFlags.cmake @@ -1,4 +1,3 @@ - macro (add_flags_lnk FLAGS) set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${FLAGS}") set(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} ${FLAGS}") @@ -49,9 +48,6 @@ macro(set_flags) else() add_flags_cxx("-pthread") endif() - - #we support non-IEEE 754 fpus so can make no guarentees about error - add_flags_cxx("-ffast-math") else() # Let gcc / clang know that we're compiling a multi-threaded app: @@ -65,8 +61,6 @@ macro(set_flags) # We use a signed char (fixes #640 on RasPi) add_flags_cxx("-fsigned-char") - #we support non-IEEE 754 fpus so can make no guarentees about error - add_flags_cxx("-ffast-math") endif() @@ -189,6 +183,9 @@ macro(set_exe_flags) string(REPLACE "-w" "" CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG}") string(REPLACE "-w" "" CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG}") add_flags_cxx("-Wall -Wextra") + + #we support non-IEEE 754 fpus so can make no guarentees about error + add_flags_cxx("-ffast-math") endif() endmacro() -- cgit v1.2.3 From 95ea0ef43dfbcf2240a0ece70d2829ce63ab0dd3 Mon Sep 17 00:00:00 2001 From: worktycho Date: Fri, 7 Mar 2014 17:22:37 +0000 Subject: Fixed clang compile --- SetFlags.cmake | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'SetFlags.cmake') diff --git a/SetFlags.cmake b/SetFlags.cmake index a5bd3a0a2..6a8211fa2 100644 --- a/SetFlags.cmake +++ b/SetFlags.cmake @@ -184,8 +184,13 @@ macro(set_exe_flags) string(REPLACE "-w" "" CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG}") add_flags_cxx("-Wall -Wextra") - #we support non-IEEE 754 fpus so can make no guarentees about error + # we support non-IEEE 754 fpus so can make no guarentees about error add_flags_cxx("-ffast-math") + + # clang does not provide the __extern_always_inline macro and a part of libm depends on this when using fast-math + if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") + add_flags_cxx("-D__extern_always_inline=inline") + endif() endif() endmacro() -- cgit v1.2.3