Skip to content

Commit

Permalink
Merge pull request #24182 from charris/backport-24060
Browse files Browse the repository at this point in the history
BLD: use ``-ftrapping-math`` with Clang on macOS
  • Loading branch information
charris committed Jul 14, 2023
2 parents ef46300 + 621390f commit b12a3ad
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,15 @@ endif
add_project_arguments(
cc.get_supported_arguments( '-fno-strict-aliasing'), language : 'c'
)
#
# Clang defaults to a non-strict floating error point model, but we need strict
# behavior. `-ftrapping-math` is equivalent to `-ffp-exception-behavior=strict`.
# Note that this is only supported on macOS arm64 as of XCode 14.3
if cc.get_id() == 'clang'
add_project_arguments(
cc.get_supported_arguments('-ftrapping-math'), language: ['c', 'cpp'],
)
endif

# Generate version number. Note that this will not (yet) update the version
# number seen by pip or reflected in wheel filenames. See
Expand Down

0 comments on commit b12a3ad

Please sign in to comment.