Add math optimization flags
MODIFY
CMakeLists.txt
CMakeLists.txt
@@ -232,6 +232,11 @@ target_include_directories(
${CMAKE_CURRENT_SOURCE_DIR}/src/generated
)
+# Optimize floating point math functions into intrinsics and don't check or set errno (i.e. sqrt(-1))
+if (NOT CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
+ target_compile_options(lcf PUBLIC "-fno-math-errno")
+endif()
+
# endianess checking
if(NOT DEFINED CMAKE_TOOLCHAIN_FILE)
include(TestBigEndian)

MODIFY
Makefile.am
Makefile.am
@@ -22,6 +22,7 @@ liblcf_la_CPPFLAGS = \
-I$(srcdir)/src/generated
liblcf_la_CXXFLAGS = \
-std=c++14 \
+ -fno-math-errno \
$(AM_CXXFLAGS) \
$(EXPAT_CFLAGS) \
$(ICU_CFLAGS)

Add math optimization flags