aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--CMakeLists.txt5
1 files changed, 5 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index ac1133d4..efb06ebf 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -330,6 +330,11 @@ ELSE()
ENDIF()
ENDFOREACH()
+ CHECK_C_COMPILER_FLAG(-fno-math-errno HAVE_FNO_MATH_ERRNO)
+ IF(HAVE_FNO_MATH_ERRNO)
+ SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} -fno-math-errno")
+ ENDIF()
+
CHECK_C_SOURCE_COMPILES("int foo() __attribute__((destructor));
int main() {return 0;}" HAVE_GCC_DESTRUCTOR)