diff --git a/CMakeLists.txt b/CMakeLists.txt index e3ae3b7ff..cbddde251 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -128,6 +128,10 @@ set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${PROC_FLAGS}") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror=unused-label") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror=delete-incomplete") +# Do net set math errno, as we never check its value. +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-math-errno") +set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fno-math-errno") + # Special treatment for x87 and x86-32 SSE (see GitHub issue #4324) include(FindX87Math) if(HAVE_X87_MATH)