Skip to content

Commit

Permalink
fix: disable -ffinite-math-only on x86 (#5051)
Browse files Browse the repository at this point in the history
  • Loading branch information
zchrissirhcz committed Sep 25, 2023
1 parent 69d6051 commit 7377f1b
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -341,11 +341,10 @@ else()
set_target_properties(ncnn PROPERTIES POSITION_INDEPENDENT_CODE ON INTERFACE_POSITION_INDEPENDENT_CODE ON)
endif()

if(CMAKE_BUILD_TYPE MATCHES "(Release|RELEASE|release)")
if(CMAKE_BUILD_TYPE MATCHES "(Release|RELEASE|release)" AND (NOT(NCNN_TARGET_ARCH STREQUAL "x86")))
if(NOT CMAKE_SYSTEM_NAME STREQUAL "Emscripten" AND NOT (CMAKE_CXX_COMPILER_ID MATCHES "GNU" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.6))
target_compile_options(ncnn PRIVATE -Ofast)
endif()

target_compile_options(ncnn PRIVATE -ffast-math)
endif()

Expand Down

0 comments on commit 7377f1b

Please sign in to comment.