
cmake_minimum_required(VERSION 3.15)

project(SimpleFastFloatBenchmark VERSION 0.1.0 LANGUAGES CXX)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

if (NOT CMAKE_BUILD_TYPE)
  message(STATUS "No build type selected, default to Release")
  set(CMAKE_BUILD_TYPE Release CACHE STRING "Choose the type of build." FORCE)
endif()

add_executable(benchmark benchmark.cpp)

add_executable(benchmark_trap benchmark.cpp)
target_compile_options(benchmark_trap PUBLIC -ftrapv)

add_executable(benchmark_ubsan benchmark.cpp)
# only enable overflow check of ubsan
target_compile_options(benchmark_ubsan PUBLIC -fsanitize=signed-integer-overflow -fsanitize-undefined-trap-on-error)
