diff --git a/cmake/flags.cmake b/cmake/flags.cmake index 60bb0e9..43f654d 100644 --- a/cmake/flags.cmake +++ b/cmake/flags.cmake @@ -30,7 +30,7 @@ if (CMAKE_CXX_COMPILER_ID MATCHES GNU) if (DEV_WITH_TSAN OR DEV_WITH_UBSAN OR DEV_WITH_ASAN) set(OPTIMIZATION_FLAGS "-Og -g") else() - set(OPTIMIZATION_FLAGS "-Ofast -s") + set(OPTIMIZATION_FLAGS "-O3 -ffast-math -s") endif() if (WITH_LTO) @@ -102,7 +102,7 @@ elseif (CMAKE_CXX_COMPILER_ID MATCHES Clang) if (DEV_WITH_MSAN) set(OPTIMIZATION_FLAGS "-Og -g") else() - set(OPTIMIZATION_FLAGS "-Ofast -funroll-loops -fmerge-all-constants") + set(OPTIMIZATION_FLAGS "-O3 -ffast-math -funroll-loops -fmerge-all-constants") endif() if (WITH_LTO) diff --git a/tests/cmake/flags.cmake b/tests/cmake/flags.cmake index 3eb62ba..c3be48f 100644 --- a/tests/cmake/flags.cmake +++ b/tests/cmake/flags.cmake @@ -1,7 +1,7 @@ if (CMAKE_CXX_COMPILER_ID MATCHES GNU) set(GENERAL_FLAGS "-pthread") set(WARNING_FLAGS "-Wall -Wextra") - set(OPTIMIZATION_FLAGS "-Ofast -s") + set(OPTIMIZATION_FLAGS "-O3 -ffast-math -s") if (WITH_LTO) set(OPTIMIZATION_FLAGS "${OPTIMIZATION_FLAGS} -flto=auto -fuse-linker-plugin") @@ -45,7 +45,7 @@ elseif (CMAKE_CXX_COMPILER_ID MATCHES Clang) endif() set(WARNING_FLAGS "-Wall -Wextra -Wno-undefined-internal") - set(OPTIMIZATION_FLAGS "-Ofast -funroll-loops -fmerge-all-constants") + set(OPTIMIZATION_FLAGS "-O3 -ffast-math -funroll-loops -fmerge-all-constants") if (WITH_LTO) set(OPTIMIZATION_FLAGS "${OPTIMIZATION_FLAGS} -flto")