Skip to content

Commit f521e21

Browse files
authored
Merge pull request #364 from fmatthew5876/cxxopt
Add math optimization flags
2 parents eda827a + bc53022 commit f521e21

2 files changed

Lines changed: 6 additions & 0 deletions

File tree

CMakeLists.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,11 @@ target_include_directories(
232232
${CMAKE_CURRENT_SOURCE_DIR}/src/generated
233233
)
234234

235+
# Optimize floating point math functions into intrinsics and don't check or set errno (i.e. sqrt(-1))
236+
if (NOT CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
237+
target_compile_options(lcf PUBLIC "-fno-math-errno")
238+
endif()
239+
235240
# endianess checking
236241
if(NOT DEFINED CMAKE_TOOLCHAIN_FILE)
237242
include(TestBigEndian)

Makefile.am

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ liblcf_la_CPPFLAGS = \
2222
-I$(srcdir)/src/generated
2323
liblcf_la_CXXFLAGS = \
2424
-std=c++14 \
25+
-fno-math-errno \
2526
$(AM_CXXFLAGS) \
2627
$(EXPAT_CFLAGS) \
2728
$(ICU_CFLAGS)

0 commit comments

Comments
 (0)