aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2017-04-26 18:35:05 -0700
committerChris Robinson <[email protected]>2017-04-26 18:35:05 -0700
commit1754d54c18b58995718d2695151a945ee232b0f1 (patch)
treef4443a5335742c5a6d03c3941f46afc651069386
parent12fb0404c18ec280d13a68237212f57a8242af8f (diff)
Compile with -fno-math-errno when available
Helps GCC to inline some fp functions, e.g. lrintf
-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)