From 90b4d1b6af524463553eb580def01e755de61fa6 Mon Sep 17 00:00:00 2001 From: Max Luebke Date: Wed, 6 Apr 2022 10:08:45 +0200 Subject: [PATCH] Define option to toggle '-ffast-math' --- CMakeLists.txt | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index cb7a12b..c7a8a8e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -18,5 +18,15 @@ set(CMAKE_BUILD_TYPE "${CMAKE_BUILD_TYPE}" CACHE STRING "Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel GenericOpt." FORCE) +option(USE_UNSAFE_MATH_OPT + "Use compiler options to break IEEE compliances by + oenabling reordering of instructions when adding/multiplying of floating + points." + OFF) + +if(USE_UNSAFE_MATH_OPT) + add_compile_options(-ffast-math) +endif() + add_subdirectory(app) add_subdirectory(src)