Skip to content

Commit

Permalink
Disable unwantd FMAs with clang 14
Browse files Browse the repository at this point in the history
Fixes #375
  • Loading branch information
mmp committed Sep 18, 2023
1 parent 83e4599 commit 323da4d
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,11 @@ else ()
message (STATUS "Found -lprofiler: ${PROFILE_LIB}")
endif ()

if (CMAKE_CXX_COMPILER_ID MATCHES "Clang" AND CMAKE_CXX_COMPILER_VERSION GREATER_EQUAL 14)
message (STATUS "Disabling -ffp-contract (thanks, clang 14!)")
list (APPEND PBRT_CXX_FLAGS "-ffp-contract=off")
endif ()

add_library (pbrt_warnings INTERFACE)
target_compile_options (
pbrt_warnings
Expand Down

0 comments on commit 323da4d

Please sign in to comment.